Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Small 25 line program
#21
Hmm... odd how Charlie's runs faster but both loops are _Limit 30?
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply
#22
(11-20-2022, 07:05 PM)bplus Wrote: Hmm... odd how Charlie's runs faster but both loops are _Limit 30?

That would be because I don't see much point in implementing the _limit statement.

Largely because i'm getting in paralysis by analysis by the tought: what if some iterations of a loop are slower than other iterations for whatever reason.  _limit 30 might slow down a program too much in that circumstance.

Then, if some iterations are really too fast, then _limit 30 might not be a high enough number.

The easy way out: have BAM recognize the statement, but totally ignore it.  (related: Programming Reference)

QB64 is so much faster than BAM, that ignoring _LIMIT in BAM doesn't seem to make a significant difference:  "limited" QB64 and "no-limit" BAM are going at reasonably the same speed.

Well, another big part: bad ADHD over here (along with nonstop sensory and cognitive overload), constantly distracted by discomfort from a physical ailment (no pain, thank goodness.)  To keep me from going totally insane, I have to do extremely interesting things to ignore the discomfort.  Properly implementing _LIMIT doesn't float my boat at the moment.  But at some point, it might just become the most interesting thing to me.  But everything is a shiny object, so I wouldn't be holding my breath ...
Reply
#23
Good news! visionmercer found a couple more versions from SpecBas source!
Code: (Select All)
' A loose translation of bubble_universe2
' https://github.com/ZXDunny/SpecBAS-Demos/blob/master/Graphics/bubble_universe2
Const w = 480
Const m = 200
Const r = _Pi * 2
Dim x, y, t, i, j, u
Screen _NewImage(w, w, 32)
Do
    Cls
    For i = 0 To m
        For j = 0 To m
            u = Sin(i + y) + Sin(i + x)
            y = Cos(i + y) + Cos(i + x)
            x = u + t
            PSet (u * m / 2 + w / 2, y * m / 2 + w / 2.3), _RGB(j, i, 127)
        Next
    Next
    t = t + .1 ' << try .01
    _Display
    _Limit 30
Loop

Code: (Select All)
' A loose translation of bubble_universe3
' https://github.com/ZXDunny/SpecBAS-Demos/blob/master/Graphics/bubble_universe3
const w = 480, n = 200
dim x
dim y
dim t: t = 9
screen _newimage(480, 480, 32)
do
    cls
    for i=0 to n
    for j=0 to n
        u=sin(i+y) + sin(j/(n*_pi)+x)
        v=cos(i+y) + cos(j/(n*_pi)+x)
        x = u + t
        y = v + t
        pset (u*100+w/2, v*100+w/2),_rgb(i,j,99)
    next j,i
    t = t + .1  ' I am running .01
_display
_limit 30
loop
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Qix line monster Abazek 2 829 01-22-2025, 03:25 AM
Last Post: Jack002
  Another small filled circe sub (not as fast as fcirc) Dav 115 23,206 09-06-2024, 03:23 PM
Last Post: bplus
  "5-line" engine James D Jarvis 35 7,744 02-16-2024, 11:06 AM
Last Post: Jack
  A Small Game Tutorial (from 2014) SMcNeill 2 964 11-13-2023, 09:11 PM
Last Post: Kernelpanic
  Small exploding image and fade-out effect Dav 18 3,508 09-08-2023, 11:16 PM
Last Post: dbox

Forum Jump:


Users browsing this thread: 1 Guest(s)