Re: A Little QBasic help

new topic     » goto parent     » topic index » view thread      » older message » newer message

Irv wrote:
>
> RND * 2 - 1 MOD 10 returns a number between -1 and 0, replace with
>
>  rand(2)-2 -- returns either 1 or 2, minus 2 equals either zero or minus
> 1
>
OOPS! Actually, that returns a real ranging from -1 to +1, but since it
is being assigned to an integer (thru addition), you can just as easily
use rand(3) - 2 -- which will be either 1,0,or -1.
At least, I think so. Does this program do some neat graphics?

Corrections encouraged.

Irv

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu