Qbasicnews.com

Full Version: cross your eyes and concentrate!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I noticed Binary Shock's "random" generator had a distinct visual pattern to it. The empty spots (where no numbers were generated) congregated in rings...

At first it will appear like a random JPEG, and then like a sea wave, but you WILL see expanding and contrasting blobs, once it gets bright enough.

PS: No timing controls. Might be too fast on 3ghz processors. Add a timer if you can...

Code:
RANDOMIZE TIMER: SCREEN 13
a% = 0
FOR i& = 0 TO 31
i2& = i& * 65536: i3& = i& * 256: i2& = i2& + i3&
PALETTE i&, i2&: PALETTE 63 - i&, i3& + i&
NEXT i&
DO
n2% = (n2% + 1) MOD 4096
n% = SQR(n2%)
FOR q = 1 TO 10000
n3% = INT(RND * 8) - 4 + n%
IF n3% > 63 THEN n3% = 63
PSET (Rand(0, 320), Rand(0, 200)), n3%
NEXT q
t = t + 1
LOOP UNTIL INKEY$ <> ""

DEFINT A-Z
FUNCTION Rand (Min, Max)
'binarySHOCK's code
STATIC Cnt AS LONG, Cnt2 AS LONG, LastMin, LastMax
STATIC LastValue
Ran = Max - Min
Cnt = (Cnt + (LastMin + LastMax)) AND 8167
Cnt2 = (Cnt2 + ((Cnt MOD (Max + Min)))) AND 2097151
D& = ((Cnt + Cnt2) XOR (Ran + Min))
D2 = (D& + LastValue) MOD (Ran + 1) + Min
Rand = D2
LastValue = D2
LastMin = Min
LastMax = Max
END FUNCTION

PS: a dark room yields better results.
onw word: 'wierd' :o
I couldn't see it. Maybe someone else can.
Quote:I couldn't see it. Maybe someone else can.
just wait for awhile
Neat! So I'm not the only one who can see it!
cant see it either
Yea, i saw it, but it takes a little bit to recognize it.
OMG IT'S A MIDGET WITH A CHAINSAW RIDING AN OSTRICH!!!!!!!11

Anonymous

fRICKin Plasma Smile
nyuk nyuk nyuk...

no randomizing formula is perfect. but if you have to look closely it's good enough Smile