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?
b = b + ...
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
b = b + ...
Reply




Users browsing this thread: 3 Guest(s)