0 Members and 1 Guest are viewing this topic.
rand^n generates a random number from 0 to N-1.and you can have Lbl B and variable B and the program will have no issue
You can use rectI() (inverted rectangle) to make all sorts of fun effects. To make a white rectangle with black borders, simply draw a black rectangle and then an inverted one that is inside of it
If Y>=9 or (X<=71//All getKeys codeEnd
if getkey(keycode) If x/y (any) != (max/min for x/y value) ; choose the fitting onex/y(any) +/-1 ->x/y ; idemend
You should use:Code: [Select]if getkey(keycode) If x/y (any) != (max/min for x/y value) ; choose the fitting onex/y(any) +/-1 ->x/y ; idemend
If getKey(1)If X/Y != 71/9X/Y +1 ->X/YEnd
.SCROLLJP ;Scroll-Jump :P0→X20→YRepeat getkey(15)ClrDrawIf getKey(2)X+1→X ;that cool arrow do you type with left-alt + 2 6 EndIf getKey(3)X-1→XEndPt-On(X,Y,[FF818181818181FF])If X>88Pt-On(X-96,Y,[FF818181818181FF])EndIf X=960→XEndIf X=666Disp "The Game",imaginary i,"Never Gonna Give You up" ; Could not resist xDIf X≤65535Pt-On(X+96,Y,[FF818181818181FF])EndIf X=6552888→XEndDispGraphEndReturn
:..GETKEYS:DispGraphClrDraw:If getKey(1) and (Y<59:Y+2→Y:End:If getKey(2):X-2→X:End:If X>88:Pt-On(X-96,Y,[FE44381000000000:End:If X=96:0→X:End:If getKey(3):X+2→X:End:If X≤65535:Pt-On(X+96,Y,[FE44381000000000:End:If X=65528:88→X:End:If getKey(4) and (Y>8:Y-2→Y:End
:..GETKEYS:DispGraphClrDraw:If getKey(1) and (Y<59:Y+2→Y:End:If getKey(2):X-2→X:End:If X=96:0→X:End:If getKey(3):X+2→X:End:If X=0:88→X:End:If getKey(4) and (Y>8:Y-2→Y:End
rand^n.THIS GENERATES A RANDOM NUMBER UP TO N-1
Think about it:rand generates a number between 0 and 255.
Lbl RAN ... Returns a random number from r1 to r2, excluding r2. r3 is the increment. ... r2-r1/r3 rand^ *r3+r1Return
Code: [Select]Lbl RAN ... Returns a random number from r1 to r2, excluding r2. r3 is the increment. ... r2-r1/r3 rand^ *r3+r1ReturnI think that works?