• recursive basic...

    From Chris M. Thomasson@[email protected] to comp.theory on Wed Nov 5 12:33:59 2025
    From Newsgroup: comp.theory

    This might be interesting to Olcott... We can use another stack, and
    keep entire state on it, as we recurse. The phantom stack? This actually
    is kind of a simulator in a loose sense. I have full control over the recursion stack?

    https://pastebin.com/raw/Effeg8cK

    Can run it here:

    https://www.calormen.com/jsbasic/

    code:
    ___________________
    100 REM ct_vfield_applesoft_basic
    110 HOME
    120 HGR: HCOLOR = 3: VTAB 22
    130 PRINT "ct_vfield_applesoft_basic"
    140 GOSUB 1000
    150 GOSUB 3000
    160 SP = 0
    170 RS(SP, 0) = 0
    180 RS(SP, 1) = -1
    190 RS(SP, 2) = 0
    200 RS(SP, 3) = 1
    210 RS(SP, 4) = 0
    220 GOSUB 8000
    230 V1(1) = 0: V1(2) = 0: V1(3) = 1: V1(4) = 128
    240 GOSUB 6000
    245 PRINT "Chris Thomasson's Koch Complete!"
    250 END

    1000 REM ct_init
    1010 PRINT "ct_init"
    1020 DIM A0(6)
    1030 DIM V0(4)
    1040 DIM V1(4)
    1050 DIM V2(4)
    1060 DIM V3(4)
    1070 DIM V4(4)
    1080 DIM V5(4)
    1090 RN = 3
    1100 DIM RS(RN, 16)
    1110 GOSUB 2000
    1120 RETURN

    2000 REM ct_init_plane
    2010 PRINT "ct_init_plane"
    2020 A0(1) = 279: REM m_plane.m_width
    2030 A0(2) = 191: REM m_plane.m_height
    2040 A0(3) = 0.0126106: REM m_plane.m_xstep
    2050 A0(4) = 0.0126316: REM m_plane.m_ystep
    2060 A0(5) = -1.75288: REM m_plane.m_axes.m_xmin
    2070 A0(6) = 1.2: REM m_plane.m_axes.m_ymax
    2080 RETURN

    3000 REM ct_display_plane
    3010 PRINT "ct_display_plane"
    3020 FOR I0 = 1 TO 6
    3030 PRINT "A0("; I0; ") = " A0(I0)
    3040 NEXT I0
    3050 RETURN

    4000 REM ct_project_point
    4010 REM PRINT "ct_project_point"
    4020 V0(3) = (V0(1) - A0(5)) / A0(3)
    4030 V0(4) = (A0(6) - V0(2)) / A0(4)
    4040 IF V0(3) < 0 THEN V0(3) = INT(V0(3) - .5)
    4050 IF V0(3) >= 0 THEN V0(3) = INT(V0(3) + .5)
    4060 IF V0(4) < 0 THEN V0(4) = INT(V0(4) - .5)
    4070 IF V0(4) >= 0 THEN V0(4) = INT(V0(4) + .5)
    4080 RETURN

    5000 REM ct_plot_point
    5010 REM PRINT "ct_plot_point"
    5020 GOSUB 4000
    5030 IF V0(3) > -1 AND V0(3) <= A0(1) AND V0(4) > -1 AND V0(4) <=
    A0(2) THEN HPLOT V0(3), V0(4)
    5040 RETURN

    6000 REM ct_plot_circle
    6010 PRINT "ct_plot_circle"
    6020 AB = 6.28318 / V1(4)
    6030 FOR I1 = 0 TO 6.28318 STEP AB
    6040 V0(1) = V1(1) + COS(I1) * V1(3)
    6050 V0(2) = V1(2) + SIN(I1) * V1(3)
    6060 GOSUB 5000
    6070 NEXT I1
    6080 RETURN

    7000 REM ct_plot_line
    7010 PRINT "ct_plot_line"
    7020 V0(1) = V5(1): V0(2) = V5(2)
    7030 GOSUB 4000
    7040 IF V0(3) < 0 THEN V0(3) = 0
    7050 IF V0(3) > A0(1) THEN V0(3) = A0(1)
    7060 IF V0(4) < 0 THEN V0(4) = 0
    7070 IF V0(4) > A0(2) THEN V0(4) = A0(2)
    7080 HPLOT V0(3), V0(4)
    7090 V0(1) = V5(3): V0(2) = V5(4)
    7100 GOSUB 4000
    7110 IF V0(3) < 0 THEN V0(3) = 0
    7120 IF V0(3) > A0(1) THEN V0(3) = A0(1)
    7130 IF V0(4) < 0 THEN V0(4) = 0
    7140 IF V0(4) > A0(2) THEN V0(4) = A0(2)
    7150 HPLOT TO V0(3), V0(4)
    7160 RETURN

    8000 REM ct_koch
    8010 IF RS(SP, 0) >= RN THEN RETURN
    8020 PRINT "ct_koch = "; RS(SP, 0); " "; RS(SP, 1); " "; RS(SP, 2);
    " "; RS(SP, 3); " "; RS(SP, 4)"
    8030 RS(SP, 5) = RS(SP, 3) - RS(SP, 1) : REM difx
    8040 RS(SP, 6) = RS(SP, 4) - RS(SP, 2) : REM dify
    8050 RS(SP, 7) = RS(SP, 1) + RS(SP, 5) / 2 : REM dify
    8060 RS(SP, 8) = RS(SP, 2) + RS(SP, 6) / 2 : REM dify
    8070 RS(SP, 9) = -RS(SP, 6) : REM perpx
    8080 RS(SP, 10) = RS(SP, 5) : REM perpy
    8090 RS(SP, 11) = RS(SP, 7) + RS(SP, 9) / 3 : REM tipx
    8100 RS(SP, 12) = RS(SP, 8) + RS(SP, 10) / 3 : REM tipy
    8110 RS(SP, 13) = RS(SP, 1) + RS(SP, 5) / 3 : REM k0x
    8120 RS(SP, 14) = RS(SP, 2) + RS(SP, 6) / 3 : REM k0y
    8130 RS(SP, 15) = RS(SP, 3) - RS(SP, 5) / 3 : REM k1x
    8140 RS(SP, 16) = RS(SP, 4) - RS(SP, 6) / 3 : REM k1y

    8145 IF RS(SP, 0) < RN - 1 GOTO 8230
    8150 V5(1) = RS(SP, 1): V5(2) = RS(SP, 2): V5(3) = RS(SP, 13): V5(4)
    = RS(SP, 14)
    8160 GOSUB 7000
    8170 V5(1) = RS(SP, 13): V5(2) = RS(SP, 14): V5(3) = RS(SP, 11):
    V5(4) = RS(SP, 12)
    8180 GOSUB 7000
    8190 V5(1) = RS(SP, 11): V5(2) = RS(SP, 12): V5(3) = RS(SP, 15):
    V5(4) = RS(SP, 16)
    8200 GOSUB 7000
    8210 V5(1) = RS(SP, 15): V5(2) = RS(SP, 16): V5(3) = RS(SP, 3):
    V5(4) = RS(SP, 4)
    8220 GOSUB 7000

    8230 REM line 0
    8240 SP = SP + 1
    8250 RS(SP, 0) = RS(SP - 1, 0) + 1
    8260 RS(SP, 1) = RS(SP - 1, 1)
    8270 RS(SP, 2) = RS(SP - 1, 2)
    8280 RS(SP, 3) = RS(SP - 1, 13)
    8290 RS(SP, 4) = RS(SP - 1, 14)
    8300 GOSUB 8000
    8310 SP = SP - 1
    8320 REM line 1
    8330 SP = SP + 1
    8340 RS(SP, 0) = RS(SP - 1, 0) + 1
    8350 RS(SP, 1) = RS(SP - 1, 13)
    8360 RS(SP, 2) = RS(SP - 1, 14)
    8370 RS(SP, 3) = RS(SP - 1, 11)
    8380 RS(SP, 4) = RS(SP - 1, 12)
    8390 GOSUB 8000
    8400 SP = SP - 1
    8410 REM line 2
    8420 SP = SP + 1
    8430 RS(SP, 0) = RS(SP - 1, 0) + 1
    8440 RS(SP, 1) = RS(SP - 1, 11)
    8450 RS(SP, 2) = RS(SP - 1, 12)
    8460 RS(SP, 3) = RS(SP - 1, 15)
    8470 RS(SP, 4) = RS(SP - 1, 16)
    8480 GOSUB 8000
    8490 SP = SP - 1
    8500 REM line 3
    8510 SP = SP + 1
    8520 RS(SP, 0) = RS(SP - 1, 0) + 1
    8530 RS(SP, 1) = RS(SP - 1, 15)
    8540 RS(SP, 2) = RS(SP - 1, 16)
    8550 RS(SP, 3) = RS(SP - 1, 3)
    8560 RS(SP, 4) = RS(SP - 1, 4)
    8570 GOSUB 8000
    8580 SP = SP - 1
    8590 RETURN
    ___________________


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Chris M. Thomasson@[email protected] to comp.theory on Wed Nov 5 12:39:27 2025
    From Newsgroup: comp.theory

    On 11/5/2025 12:33 PM, Chris M. Thomasson wrote:
    This might be interesting to Olcott... We can use another stack, and
    keep entire state on it, as we recurse. The phantom stack? This actually
    is kind of a simulator in a loose sense. I have full control over the recursion stack?

    https://pastebin.com/raw/Effeg8cK

    Can run it here:

    https://www.calormen.com/jsbasic/

    code:
    ___________________

    [...]

    It allows us to do strange shit. Like altering a prior recursion
    stack... Hack galore!

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Chris M. Thomasson@[email protected] to comp.theory on Wed Nov 5 13:06:40 2025
    From Newsgroup: comp.theory

    On 11/5/2025 12:39 PM, Chris M. Thomasson wrote:
    On 11/5/2025 12:33 PM, Chris M. Thomasson wrote:
    This might be interesting to Olcott... We can use another stack, and
    keep entire state on it, as we recurse. The phantom stack? This
    actually is kind of a simulator in a loose sense. I have full control
    over the recursion stack?

    https://pastebin.com/raw/Effeg8cK

    Can run it here:

    https://www.calormen.com/jsbasic/

    code:
    ___________________

    [...]

    It allows us to do strange shit. Like altering a prior recursion
    stack... Hack galore!


    Actually, I can get rid of GOSUB on my Koch recursion line 8000 by using
    a symbolic dispatch table. A return address would be stored in the stack frames...
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Chris M. Thomasson@[email protected] to comp.theory on Wed Nov 5 13:45:33 2025
    From Newsgroup: comp.theory

    On 11/5/2025 1:06 PM, Chris M. Thomasson wrote:
    On 11/5/2025 12:39 PM, Chris M. Thomasson wrote:
    On 11/5/2025 12:33 PM, Chris M. Thomasson wrote:
    This might be interesting to Olcott... We can use another stack, and
    keep entire state on it, as we recurse. The phantom stack? This
    actually is kind of a simulator in a loose sense. I have full control
    over the recursion stack?

    https://pastebin.com/raw/Effeg8cK

    Can run it here:

    https://www.calormen.com/jsbasic/

    code:
    ___________________

    [...]

    It allows us to do strange shit. Like altering a prior recursion
    stack... Hack galore!


    Actually, I can get rid of GOSUB on my Koch recursion line 8000 by using
    a symbolic dispatch table. A return address would be stored in the stack frames...

    ROFL! Getting rid of GOSUB. Just need to hook it up to my stack frames: __________________
    1 HOME
    10 REM ct_dispatch concept... lol ;^)
    20 PRINT "PING " : A$ = "30" : GOTO 1000
    30 PRINT "PONG"
    40 A$ = "666" : GOTO 1000

    666 PRINT "FIN! :^D"
    670 END

    1000 REM ct_dispatch
    1010 if A$ = "30" GOTO 30
    1020 if A$ = "666" GOTO 666
    1030 PRINT "WTF!"
    1040 END
    __________________

    lol! Continuations, strange stack frame hacking, alter prior recursions, ect... All in AppleSoft basic? ;^)
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Chris M. Thomasson@[email protected] to comp.theory on Wed Nov 5 16:56:03 2025
    From Newsgroup: comp.theory

    On 11/5/2025 12:33 PM, Chris M. Thomasson wrote:
    This might be interesting to Olcott... We can use another stack, and
    keep entire state on it, as we recurse. The phantom stack? This actually
    is kind of a simulator in a loose sense. I have full control over the recursion stack?

    https://pastebin.com/raw/Effeg8cK

    Can run it here:

    https://www.calormen.com/jsbasic/

    code:
    ___________________
    100 REM ct_vfield_applesoft_basic
    110     HOME
    120     HGR: HCOLOR = 3: VTAB 22
    130     PRINT "ct_vfield_applesoft_basic"
    140     GOSUB 1000
    150     GOSUB 3000
    160     SP = 0
    170     RS(SP, 0) = 0
    180     RS(SP, 1) = -1
    190     RS(SP, 2) = 0
    200     RS(SP, 3) = 1
    210     RS(SP, 4) = 0
    220     GOSUB 8000
    230     V1(1) = 0: V1(2) = 0: V1(3) = 1: V1(4) = 128
    240     GOSUB 6000
    245     PRINT "Chris Thomasson's Koch Complete!"
    250 END

    1000 REM ct_init
    1010     PRINT "ct_init"
    1020     DIM A0(6)
    1030     DIM V0(4)
    1040     DIM V1(4)
    1050     DIM V2(4)
    1060     DIM V3(4)
    1070     DIM V4(4)
    1080     DIM V5(4)
    1090     RN = 3
    1100     DIM RS(RN, 16)
    1110         GOSUB 2000
    1120 RETURN
    [...]

    Actually, for my recursion stack, DIM RS(RN, 16) can be DIM RS(RF, RN,
    16) where RF is the number of functions that use it, each with a unique
    index into it...

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mike Terry@[email protected] to comp.theory on Thu Nov 6 02:09:17 2025
    From Newsgroup: comp.theory

    On 05/11/2025 20:33, Chris M. Thomasson wrote:
    This might be interesting to Olcott... We can use another stack, and keep entire state on it, as we
    recurse. The phantom stack? This actually is kind of a simulator in a loose sense. I have full
    control over the recursion stack?

    https://pastebin.com/raw/Effeg8cK

    Can run it here:

    https://www.calormen.com/jsbasic/

    code:
    ___________________
    100 REM ct_vfield_applesoft_basic
    110 HOME
    120 HGR: HCOLOR = 3: VTAB 22
    <..snip..>

    Why do you present code in line-numbered basic? There was a time when I was paid to write
    production code in a similar language (QBasic?) but that language's day has passed (35,40 years
    ago!) and I for one will not seriously examine any more code like that today.

    Are you the only person here who doesn't code (as a minimum) in C?

    Mike.


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From olcott@[email protected] to comp.theory on Wed Nov 5 20:17:38 2025
    From Newsgroup: comp.theory

    On 11/5/2025 8:09 PM, Mike Terry wrote:
    On 05/11/2025 20:33, Chris M. Thomasson wrote:
    This might be interesting to Olcott... We can use another stack, and
    keep entire state on it, as we recurse. The phantom stack? This
    actually is kind of a simulator in a loose sense. I have full control
    over the recursion stack?

    https://pastebin.com/raw/Effeg8cK

    Can run it here:

    https://www.calormen.com/jsbasic/

    code:
    ___________________
    100 REM ct_vfield_applesoft_basic
    110     HOME
    120     HGR: HCOLOR = 3: VTAB 22
    <..snip..>

    Why do you present code in line-numbered basic?  There was a time when I was paid to write production code in a similar language (QBasic?) but
    that language's day has passed (35,40 years ago!) and I for one will not seriously examine any more code like that today.

    Are you the only person here who doesn't code (as a minimum) in C?

    Mike.



    One of the reasons that I *plonked* him.
    I think that he is active on the C groups.
    The basic seems to be nonsense for this
    group only.
    --
    Copyright 2025 Olcott "Talent hits a target no one else can hit; Genius
    hits a target no one else can see." Arthur Schopenhauer
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Chris M. Thomasson@[email protected] to comp.theory on Wed Nov 5 18:27:39 2025
    From Newsgroup: comp.theory

    On 11/5/2025 6:09 PM, Mike Terry wrote:
    On 05/11/2025 20:33, Chris M. Thomasson wrote:
    This might be interesting to Olcott... We can use another stack, and
    keep entire state on it, as we recurse. The phantom stack? This
    actually is kind of a simulator in a loose sense. I have full control
    over the recursion stack?

    https://pastebin.com/raw/Effeg8cK

    Can run it here:

    https://www.calormen.com/jsbasic/

    code:
    ___________________
    100 REM ct_vfield_applesoft_basic
    110     HOME
    120     HGR: HCOLOR = 3: VTAB 22
    <..snip..>

    Why do you present code in line-numbered basic?  There was a time when I was paid to write production code in a similar language (QBasic?) but
    that language's day has passed (35,40 years ago!) and I for one will not seriously examine any more code like that today.

    Are you the only person here who doesn't code (as a minimum) in C?

    :^D

    Well, actually, I code in C as well... Check this old shit out, before C11:

    https://groups.google.com/g/comp.lang.c/c/7oaJFWKVCTw/m/a8tuCuXZJ-UJ

    https://pastebin.com/raw/f207f6232
    (raw text link, no pastebin ads and shit...)

    I code in C++, Python, JavaScript, HLSL, GLSL, asm SPARC, x86, PPC at a time...

    Fwiw, here is some of my old asm code:

    some of my atomic lock/wait free work:

    https://web.archive.org/web/20060214112539/http://appcore.home.comcast.net/appcore/src/cpu/i686/ac_i686_masm_asm.html

    GCC AT&T syntax:

    https://web.archive.org/web/20060214112345/http://appcore.home.comcast.net/appcore/src/cpu/i686/ac_i686_gcc_asm.html

    I code in lots of langs. Check this out:

    https://www.shadertoy.com/view/tc2fzt

    a little GLSL test.

    A lot more. Actually I am really good with lock/wait free algos. Turn
    from that to fractals. Actually, I made the cover of an AMS calendar
    using my n-ary field line work:

    https://www.facebook.com/photo/?fbid=1218640825961580&set=pcb.1218640912628238

    2025 Calander of Mathmatical Imagery. Actually, I made it in their
    webpage. They used my render:

    Hey, its still there! :^)

    https://www.ams.org/publicoutreach/math-imagery/math-imagery


    I wanted to do this in BASIC because I loved my old Apple IIGS, and it
    seems I can create something that might be able to be kind of relevant
    to Olcott fancy sims? In AppleSoft BASIC of all things.




    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Chris M. Thomasson@[email protected] to comp.theory on Wed Nov 5 18:35:42 2025
    From Newsgroup: comp.theory

    On 11/5/2025 6:17 PM, olcott wrote:
    On 11/5/2025 8:09 PM, Mike Terry wrote:
    On 05/11/2025 20:33, Chris M. Thomasson wrote:
    This might be interesting to Olcott... We can use another stack, and
    keep entire state on it, as we recurse. The phantom stack? This
    actually is kind of a simulator in a loose sense. I have full control
    over the recursion stack?

    https://pastebin.com/raw/Effeg8cK

    Can run it here:

    https://www.calormen.com/jsbasic/

    code:
    ___________________
    100 REM ct_vfield_applesoft_basic
    110     HOME
    120     HGR: HCOLOR = 3: VTAB 22
    <..snip..>

    Why do you present code in line-numbered basic?  There was a time when
    I was paid to write production code in a similar language (QBasic?)
    but that language's day has passed (35,40 years ago!) and I for one
    will not seriously examine any more code like that today.

    Are you the only person here who doesn't code (as a minimum) in C?

    Mike.



    One of the reasons that I *plonked* him.
    I think that he is active on the C groups.
    The basic seems to be nonsense for this
    group only.


    Oh my. Actually, my recursion stack in AppleSoft Basic? I thought you
    might like it.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Chris M. Thomasson@[email protected] to comp.theory on Wed Nov 5 18:49:12 2025
    From Newsgroup: comp.theory

    On 11/5/2025 6:27 PM, Chris M. Thomasson wrote:
    On 11/5/2025 6:09 PM, Mike Terry wrote:
    On 05/11/2025 20:33, Chris M. Thomasson wrote:
    This might be interesting to Olcott... We can use another stack, and
    keep entire state on it, as we recurse. The phantom stack? This
    actually is kind of a simulator in a loose sense. I have full control
    over the recursion stack?

    https://pastebin.com/raw/Effeg8cK

    Can run it here:

    https://www.calormen.com/jsbasic/

    code:
    ___________________
    100 REM ct_vfield_applesoft_basic
    110     HOME
    120     HGR: HCOLOR = 3: VTAB 22
    <..snip..>

    Why do you present code in line-numbered basic?  There was a time when
    I was paid to write production code in a similar language (QBasic?)
    but that language's day has passed (35,40 years ago!) and I for one
    will not seriously examine any more code like that today.

    Are you the only person here who doesn't code (as a minimum) in C?

    :^D

    Well, actually, I code in C as well... Check this old shit out, before C11:

    https://groups.google.com/g/comp.lang.c/c/7oaJFWKVCTw/m/a8tuCuXZJ-UJ

    Check this one out in the same thread:

    (New release of the Dynace OO extension to C)

    https://groups.google.com/g/comp.lang.c/c/7oaJFWKVCTw/m/sSWYU9BUS_QJ




    https://pastebin.com/raw/f207f6232
    (raw text link, no pastebin ads and shit...)

    I code in C++, Python, JavaScript, HLSL, GLSL, asm SPARC, x86, PPC at a time...

    Fwiw, here is some of my old asm code:

    some of my atomic lock/wait free work:

    https://web.archive.org/web/20060214112539/http:// appcore.home.comcast.net/appcore/src/cpu/i686/ac_i686_masm_asm.html

    GCC AT&T syntax:

    https://web.archive.org/web/20060214112345/http:// appcore.home.comcast.net/appcore/src/cpu/i686/ac_i686_gcc_asm.html

    I code in lots of langs. Check this out:

    https://www.shadertoy.com/view/tc2fzt

    a little GLSL test.

    A lot more. Actually I am really good with lock/wait free algos. Turn
    from that to fractals. Actually, I made the cover of an AMS calendar
    using my n-ary field line work:

    https://www.facebook.com/photo/? fbid=1218640825961580&set=pcb.1218640912628238

    2025 Calander of Mathmatical Imagery. Actually, I made it in their
    webpage. They used my render:

    Hey, its still there! :^)

    https://www.ams.org/publicoutreach/math-imagery/math-imagery


    I wanted to do this in BASIC because I loved my old Apple IIGS, and it
    seems I can create something that might be able to be kind of relevant
    to Olcott fancy sims? In AppleSoft BASIC of all things.





    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mike Terry@[email protected] to comp.theory on Thu Nov 6 02:49:25 2025
    From Newsgroup: comp.theory

    On 06/11/2025 02:27, Chris M. Thomasson wrote:
    On 11/5/2025 6:09 PM, Mike Terry wrote:
    On 05/11/2025 20:33, Chris M. Thomasson wrote:
    This might be interesting to Olcott... We can use another stack, and keep entire state on it, as
    we recurse. The phantom stack? This actually is kind of a simulator in a loose sense. I have full
    control over the recursion stack?

    https://pastebin.com/raw/Effeg8cK

    Can run it here:

    https://www.calormen.com/jsbasic/

    code:
    ___________________
    100 REM ct_vfield_applesoft_basic
    110���� HOME
    120���� HGR: HCOLOR = 3: VTAB 22
    <..snip..>

    Why do you present code in line-numbered basic?� There was a time when I was paid to write
    production code in a similar language (QBasic?) but that language's day has passed (35,40 years
    ago!) and I for one will not seriously examine any more code like that today.

    Are you the only person here who doesn't code (as a minimum) in C?

    :^D

    Well, actually, I code in C as well... Check this old shit out, before C11:

    <..snip..>

    I wanted to do this in BASIC because I loved my old Apple IIGS, and it seems I can create something
    that might be able to be kind of relevant to Olcott fancy sims? In AppleSoft BASIC of all things.

    Just saying - I don't think that's a good choice to get engagement from other posters. It's just
    too much effort working out what's going on. (I'm not saying if you presented C then you'd suddenly
    be flooded with responses; that's down to the points you're making, but line numbered basic will put
    people off straight away...)


    Mike.

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From olcott@[email protected] to comp.theory on Wed Nov 5 21:01:56 2025
    From Newsgroup: comp.theory

    On 11/5/2025 8:49 PM, Mike Terry wrote:
    On 06/11/2025 02:27, Chris M. Thomasson wrote:
    On 11/5/2025 6:09 PM, Mike Terry wrote:
    On 05/11/2025 20:33, Chris M. Thomasson wrote:
    This might be interesting to Olcott... We can use another stack, and
    keep entire state on it, as we recurse. The phantom stack? This
    actually is kind of a simulator in a loose sense. I have full
    control over the recursion stack?

    https://pastebin.com/raw/Effeg8cK

    Can run it here:

    https://www.calormen.com/jsbasic/

    code:
    ___________________
    100 REM ct_vfield_applesoft_basic
    110     HOME
    120     HGR: HCOLOR = 3: VTAB 22
    <..snip..>

    Why do you present code in line-numbered basic?  There was a time
    when I was paid to write production code in a similar language
    (QBasic?) but that language's day has passed (35,40 years ago!) and I
    for one will not seriously examine any more code like that today.

    Are you the only person here who doesn't code (as a minimum) in C?

    :^D

    Well, actually, I code in C as well... Check this old shit out, before
    C11:

    <..snip..>

    I wanted to do this in BASIC because I loved my old Apple IIGS, and it
    seems I can create something that might be able to be kind of relevant
    to Olcott fancy sims? In AppleSoft BASIC of all things.

    Just saying - I don't think that's a good choice to get engagement from other posters.  It's just too much effort working out what's going on. (I'm not saying if you presented C then you'd suddenly be flooded with responses; that's down to the points you're making, but line numbered
    basic will put people off straight away...)


    Mike.


    That seems to be his point.
    That is why I *plonked* him.
    --
    Copyright 2025 Olcott "Talent hits a target no one else can hit; Genius
    hits a target no one else can see." Arthur Schopenhauer
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Richard Heathfield@[email protected] to comp.theory on Thu Nov 6 03:14:06 2025
    From Newsgroup: comp.theory

    On 06/11/2025 02:49, Mike Terry wrote:
    On 06/11/2025 02:27, Chris M. Thomasson wrote:

    <snip>

    I wanted to do this in BASIC because I loved my old Apple IIGS,
    and it seems I can create something that might be able to be
    kind of relevant to Olcott fancy sims? In AppleSoft BASIC of
    all things.

    Just saying - I don't think that's a good choice to get
    engagement from other posters.  It's just too much effort working
    out what's going on.  (I'm not saying if you presented C then
    you'd suddenly be flooded with responses; that's down to the
    points you're making, but line numbered basic will put people off
    straight away...)

    He also has form for trying to turn any and every thread into a
    way of showing off his fractal art. To be fair, the art is pretty
    good. The threadjacking, not so much.
    --
    Richard Heathfield
    Email: rjh at cpax dot org dot uk
    "Usenet is a strange place" - dmr 29 July 1999
    Sig line 4 vacant - apply within
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From olcott@[email protected] to comp.theory on Wed Nov 5 21:16:12 2025
    From Newsgroup: comp.theory

    On 11/5/2025 9:14 PM, Richard Heathfield wrote:
    On 06/11/2025 02:49, Mike Terry wrote:
    On 06/11/2025 02:27, Chris M. Thomasson wrote:

    <snip>

    I wanted to do this in BASIC because I loved my old Apple IIGS, and
    it seems I can create something that might be able to be kind of
    relevant to Olcott fancy sims? In AppleSoft BASIC of all things.

    Just saying - I don't think that's a good choice to get engagement
    from other posters.  It's just too much effort working out what's
    going on.  (I'm not saying if you presented C then you'd suddenly be
    flooded with responses; that's down to the points you're making, but
    line numbered basic will put people off straight away...)

    He also has form for trying to turn any and every thread into a way of showing off his fractal art. To be fair, the art is pretty good. The threadjacking, not so much.


    Yes the fractal art is excellent.
    --
    Copyright 2025 Olcott "Talent hits a target no one else can hit; Genius
    hits a target no one else can see." Arthur Schopenhauer
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Chris M. Thomasson@[email protected] to comp.theory on Thu Nov 6 12:21:10 2025
    From Newsgroup: comp.theory

    On 11/5/2025 6:09 PM, Mike Terry wrote:
    On 05/11/2025 20:33, Chris M. Thomasson wrote:
    This might be interesting to Olcott... We can use another stack, and
    keep entire state on it, as we recurse. The phantom stack? This
    actually is kind of a simulator in a loose sense. I have full control
    over the recursion stack?

    https://pastebin.com/raw/Effeg8cK

    Can run it here:

    https://www.calormen.com/jsbasic/

    code:
    ___________________
    100 REM ct_vfield_applesoft_basic
    110     HOME
    120     HGR: HCOLOR = 3: VTAB 22
    <..snip..>

    Why do you present code in line-numbered basic?  There was a time when I was paid to write production code in a similar language (QBasic?) but
    that language's day has passed (35,40 years ago!) and I for one will not seriously examine any more code like that today.

    Are you the only person here who doesn't code (as a minimum) in C?

    Well, fwiw, here is a program I made in C++ that "helps" me write BASIC.
    lol. From this I can create a whole BASIC interpreter/code generator. Actually, my recursion stack I showed in this thread has a lot of flexibility... I have access to all the stack frames. Ever since Olcott
    tried to tell me that BASIC does not handle recursion, well, I wanted to
    show him an example of real recursion, a stack, ect..., is yes,
    AppleSofty BASIC of all things. Just for fun. It's ripe for hacking. I
    can alter prior stack frames, create continuations, tail calls, ect...
    all in an old BASIC with line numbers. fun! :^)

    For some reason I thought Olcott might like it. Old BASIC does have
    recursion. Just do it manually... lol. ;^)


    My C++ helper:
    _________________________
    #include <iostream>
    #include <sstream>


    // Macro kosher? Seems to be...
    namespace ct_basic {

    struct program_counter {
    unsigned long m_origin;
    unsigned long m_cur;
    unsigned long m_inc;
    std::stringstream m_prog;

    program_counter(
    unsigned long cur = 0,
    unsigned long inc = 10
    ) : m_origin(cur), m_cur(cur), m_inc(inc) {
    }

    void line(std::stringstream const& line0) {
    m_prog << m_cur << " " << line0.str() << std::endl;
    m_cur += m_inc;
    }
    };


    template<typename T>
    void CT_ASB_ADD(std::stringstream& line, const T& mp_x)
    {
    line << mp_x << "";
    }

    template<typename T, typename... Args>
    void CT_ASB_ADD(std::stringstream& line, const T& mp_x, const
    Args&... args)
    {
    CT_ASB_ADD(line, mp_x);
    CT_ASB_ADD(line, args...);
    }

    template<typename... Args>
    void CT_ASB_LINE(program_counter& mp_pc, const Args&... args)
    {
    std::stringstream line0;
    CT_ASB_ADD(line0, args...);
    (mp_pc).line(line0);
    }

    #define CT_ASB_GOSUB(mp_pc0, mp_pc1, mp_indent) \
    CT_ASB_LINE(mp_pc0, mp_indent "GOSUB ", mp_pc1.m_origin)
    }


    int
    main()
    {
    {
    std::cout << "ctBasic testing 123... :^)\n";
    std::cout << "__________________________\n";

    {

    ct_basic::program_counter pc_ct_main(100);
    ct_basic::program_counter pc_ct_fuzzer(1000);
    ct_basic::program_counter pc_ct_program(2000);

    // ct_main
    {
    ct_basic::program_counter& PC = pc_ct_main;

    CT_ASB_LINE(PC, "REM ct_main");
    CT_ASB_LINE(PC, " PRINT \"ct_main\"");
    CT_ASB_LINE(PC, " FOR N = 0 TO 10");
    CT_ASB_GOSUB(PC, pc_ct_fuzzer, " ");
    CT_ASB_LINE(PC, " NEXT I");
    CT_ASB_LINE(PC, "END");
    }

    // ct_program
    {
    ct_basic::program_counter& PC = pc_ct_program;

    CT_ASB_LINE(PC, "REM ct_program");
    CT_ASB_LINE(PC, " PRINT \"ct_program\"");
    CT_ASB_LINE(PC, " RA$ = \"NOPE!\"");
    CT_ASB_LINE(PC, " IF R0 = 0 THEN RA$ = \"HALT!\"");
    CT_ASB_LINE(PC, "RETURN");
    }


    // ct_fuzzer
    {
    ct_basic::program_counter& PC = pc_ct_fuzzer;

    CT_ASB_LINE(PC, "REM ct_fuzzer");
    CT_ASB_LINE(PC, " PRINT \"ct_fuzzer\"");
    CT_ASB_LINE(PC, " R0 = INT(RND(0) * 10)");
    CT_ASB_GOSUB(PC, pc_ct_program, " ");
    CT_ASB_LINE(PC, "RETURN");
    }

    std::cout << pc_ct_main.m_prog.str() << "\n\n";
    std::cout << pc_ct_fuzzer.m_prog.str() << "\n\n";
    std::cout << pc_ct_program.m_prog.str() << "\n\n";
    }

    std::cout << "__________________________\n";
    }

    std::cout << "Complete! Well, time to test the\n";
    std::cout << "generated AppleSoft BASIC";

    return 0;
    }
    _________________________


    ;^D
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Chris M. Thomasson@[email protected] to comp.theory on Thu Nov 6 12:27:41 2025
    From Newsgroup: comp.theory

    On 11/5/2025 6:49 PM, Mike Terry wrote:
    On 06/11/2025 02:27, Chris M. Thomasson wrote:
    On 11/5/2025 6:09 PM, Mike Terry wrote:
    On 05/11/2025 20:33, Chris M. Thomasson wrote:
    This might be interesting to Olcott... We can use another stack, and
    keep entire state on it, as we recurse. The phantom stack? This
    actually is kind of a simulator in a loose sense. I have full
    control over the recursion stack?

    https://pastebin.com/raw/Effeg8cK

    Can run it here:

    https://www.calormen.com/jsbasic/

    code:
    ___________________
    100 REM ct_vfield_applesoft_basic
    110     HOME
    120     HGR: HCOLOR = 3: VTAB 22
    <..snip..>

    Why do you present code in line-numbered basic?  There was a time
    when I was paid to write production code in a similar language
    (QBasic?) but that language's day has passed (35,40 years ago!) and I
    for one will not seriously examine any more code like that today.

    Are you the only person here who doesn't code (as a minimum) in C?

    :^D

    Well, actually, I code in C as well... Check this old shit out, before
    C11:

    <..snip..>

    I wanted to do this in BASIC because I loved my old Apple IIGS, and it
    seems I can create something that might be able to be kind of relevant
    to Olcott fancy sims? In AppleSoft BASIC of all things.

    Just saying - I don't think that's a good choice to get engagement from other posters.

    Yeah. I see that for sure. Well, shit. I just wanted to show Olcott that
    old BASIC with line numbers can handle recursion for sure, and do fun
    things.


    It's just too much effort working out what's going on.

    Sigh. Yeah, its a bitch. However, it was a fun challenge to me. Heck, it brought me back to when I was a little kid hacking BASIC on my Apple
    IIGS and my old ATARI. lol.


    (I'm not saying if you presented C then you'd suddenly be flooded with responses; that's down to the points you're making, but line numbered
    basic will put people off straight away...)

    :^D indeed! lol. Lets code in machine language! rofl. ;^)

    But, it was fun to make my own manual recursive stack frames in BASIC.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Chris M. Thomasson@[email protected] to comp.theory on Thu Nov 6 12:45:41 2025
    From Newsgroup: comp.theory

    On 11/5/2025 1:45 PM, Chris M. Thomasson wrote:
    ROFL! Getting rid of GOSUB. Just need to hook it up to my stack frames: __________________
    1 HOME
    10 REM ct_dispatch concept... lol ;^)
    20 PRINT "PING " : A$ = "30" : GOTO 1000
    30 PRINT "PONG"
    40 A$ = "666" : GOTO 1000

    666 PRINT "FIN! :^D"
    670 END

    1000 REM ct_dispatch
    1010 if A$ = "30" GOTO 30
    1020 if A$ = "666" GOTO 666
    1030 PRINT "WTF!"
    1040 END
    __________________

    lol! Continuations, strange stack frame hacking, alter prior recursions, ect... All in AppleSoft basic? ;^)

    Actually, wrt my op recursive koch in this thread. Well, we can save the entire SP to disk, and continue it later. We save this state: _________________________
    1000 REM ct_init
    1010 PRINT "ct_init"
    1020 DIM A0(6)
    1030 DIM V0(4)
    1040 DIM V1(4)
    1050 DIM V2(4)
    1060 DIM V3(4)
    1070 DIM V4(4)
    1080 DIM V5(4)
    1090 RN = 3
    1100 DIM RS(RN, 16)
    1110 GOSUB 2000
    1120 RETURN
    _________________________

    Well, actually, RN and RS. I really should make a RS that has:

    RS(FN, RN, 16)

    Where FN is the total number of functions and RN is the limit on our
    depth. We don't have to blow the stack, we can hack the frames and GOTO
    to a good place wrt ct_dispatch logic:

    __________________
    1 HOME
    10 REM ct_dispatch concept... lol ;^)
    20 PRINT "PING " : A$ = "30" : GOTO 1000
    30 PRINT "PONG"
    40 A$ = "666" : GOTO 1000

    666 PRINT "FIN! :^D"
    670 END

    1000 REM ct_dispatch
    1010 if A$ = "30" GOTO 30
    1020 if A$ = "666" GOTO 666
    1030 PRINT "WTF!"
    1040 END
    __________________

    ;^D
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mr Flibble@[email protected] to comp.theory on Thu Nov 6 23:05:07 2025
    From Newsgroup: comp.theory

    On Thu, 06 Nov 2025 02:09:17 +0000, Mike Terry wrote:

    On 05/11/2025 20:33, Chris M. Thomasson wrote:
    This might be interesting to Olcott... We can use another stack, and
    keep entire state on it, as we recurse. The phantom stack? This
    actually is kind of a simulator in a loose sense. I have full control
    over the recursion stack?

    https://pastebin.com/raw/Effeg8cK

    Can run it here:

    https://www.calormen.com/jsbasic/

    code:
    ___________________
    100 REM ct_vfield_applesoft_basic 110 HOME 120 HGR: HCOLOR = 3:
    VTAB 22
    <..snip..>

    Why do you present code in line-numbered basic? There was a time when I
    was paid to write production code in a similar language (QBasic?) but
    that language's day has passed (35,40 years ago!) and I for one will not seriously examine any more code like that today.

    Are you the only person here who doesn't code (as a minimum) in C?

    Mike.

    You are a tool, Mike. There is nothing wrong with writing code in historic programming languages .. it can be fun. Chris is active in comp.lang.c++
    so I imagine his day job is as C++ coder and is posting BASIC here *for
    fun*.

    /Flibble
    --
    meet ever shorter deadlines, known as "beat the clock"
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Chris M. Thomasson@[email protected] to comp.theory on Thu Nov 6 17:13:41 2025
    From Newsgroup: comp.theory

    On 11/6/2025 12:21 PM, Chris M. Thomasson wrote:
    On 11/5/2025 6:09 PM, Mike Terry wrote:
    On 05/11/2025 20:33, Chris M. Thomasson wrote:
    This might be interesting to Olcott... We can use another stack, and
    keep entire state on it, as we recurse. The phantom stack? This
    actually is kind of a simulator in a loose sense. I have full control
    over the recursion stack?

    https://pastebin.com/raw/Effeg8cK

    Can run it here:

    https://www.calormen.com/jsbasic/

    code:
    ___________________
    100 REM ct_vfield_applesoft_basic
    110     HOME
    120     HGR: HCOLOR = 3: VTAB 22
    <..snip..>

    Why do you present code in line-numbered basic?  There was a time when
    I was paid to write production code in a similar language (QBasic?)
    but that language's day has passed (35,40 years ago!) and I for one
    will not seriously examine any more code like that today.

    Are you the only person here who doesn't code (as a minimum) in C?

    Well, fwiw, here is a program I made in C++ that "helps" me write BASIC.
    [...]

    Oh, I for got that I got some help wrt the templates over on
    comp.lang.c++. It was all macros before:

    ______________________________________
    #include <iostream>
    #include <sstream>


    // Macro kosher? Seems to be...
    namespace ct_basic {

    struct program_counter {
    unsigned long m_origin;
    unsigned long m_cur;
    unsigned long m_inc;
    std::stringstream m_prog;

    program_counter(
    unsigned long cur = 0,
    unsigned long inc = 10
    ) : m_origin(cur), m_cur(cur), m_inc(inc) {
    }

    void line(std::stringstream const& line0) {
    m_prog << m_cur << " " << line0.str() << std::endl;
    m_cur += m_inc;
    }
    };

    #define CT_ASB_LINE(mp_pc, mp_x) \
    { \
    std::stringstream line0; \
    line0 << mp_x; \
    (mp_pc).line(line0); \
    }


    #define CT_ASB_GOSUB(mp_pc0, mp_pc1, mp_indent) \
    CT_ASB_LINE(mp_pc0, mp_indent "GOSUB " << mp_pc1.m_origin)
    }


    int
    main()
    {
    {
    std::cout << "ctBasic testing 123... :^)\n";
    std::cout << "__________________________\n";

    {

    ct_basic::program_counter pc0(100);
    ct_basic::program_counter pc1(1000);

    // ct_main
    {
    ct_basic::program_counter& PC = pc0;

    CT_ASB_LINE(PC, "REM ct_main");
    CT_ASB_LINE(PC, " PRINT \"ct_main\"");
    CT_ASB_GOSUB(PC, pc1, " ");
    CT_ASB_LINE(PC, "END");
    }

    // ct_init
    {
    ct_basic::program_counter& PC = pc1;

    CT_ASB_LINE(PC, "REM ct_init");
    CT_ASB_LINE(PC, " PRINT \"ct_init\"");
    CT_ASB_LINE(PC, "RETURN");
    }

    std::cout << pc0.m_prog.str() << "\n\n";
    std::cout << pc1.m_prog.str() << "\n\n";
    }

    std::cout << "__________________________\n";
    }

    std::cout << "Complete! Well, time to test the\n";
    std::cout << "generated AppleSoft BASIC";

    return 0;
    }
    ______________________________________


    Fwiw, I get an output of:

    ctBasic testing 123... :^)
    __________________________
    100 REM ct_main
    110 PRINT "ct_main"
    120 GOSUB 1000
    130 END


    1000 REM ct_init
    1010 PRINT "ct_init"
    1020 RETURN


    __________________________
    Complete! Well, time to test the
    generated AppleSoft BASIC


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Chris M. Thomasson@[email protected] to comp.theory on Fri Nov 7 14:29:49 2025
    From Newsgroup: comp.theory

    On 11/6/2025 3:05 PM, Mr Flibble wrote:
    On Thu, 06 Nov 2025 02:09:17 +0000, Mike Terry wrote:

    On 05/11/2025 20:33, Chris M. Thomasson wrote:
    This might be interesting to Olcott... We can use another stack, and
    keep entire state on it, as we recurse. The phantom stack? This
    actually is kind of a simulator in a loose sense. I have full control
    over the recursion stack?

    https://pastebin.com/raw/Effeg8cK

    Can run it here:

    https://www.calormen.com/jsbasic/

    code:
    ___________________
    100 REM ct_vfield_applesoft_basic 110 HOME 120 HGR: HCOLOR = 3:
    VTAB 22
    <..snip..>

    Why do you present code in line-numbered basic? There was a time when I
    was paid to write production code in a similar language (QBasic?) but
    that language's day has passed (35,40 years ago!) and I for one will not
    seriously examine any more code like that today.

    Are you the only person here who doesn't code (as a minimum) in C?

    Mike.

    You are a tool, Mike.

    Well, I can see how my manual recursive stack in AppleSoft BASIC can
    make peoples eyes want to shoot blood out of them... ;^)


    There is nothing wrong with writing code in historic
    programming languages .. it can be fun.

    Yeah. It brings me back to when I was a little kiddo.


    Chris is active in comp.lang.c++
    so I imagine his day job is as C++ coder and is posting BASIC here *for
    fun*.

    Funny part is that I have a lot of legacy code I have to maintain. Heck,
    some of it is wordperfect 5.1 macros. God damn. lol. A home inspection reporting system that only works in DOS using Paradox. Another version
    of it in Visual Basic wrt using Access and Word 6.0. And a server I
    wrote for WinNT 4.0. Strange!

    I still have old computers. Shit happens.

    I still have MSVC 6.0 for some really old shit. ;^)
    --- Synchronet 3.21a-Linux NewsLink 1.2