randomizing

For my math class we have to create a game in truebasic where you use vectors to locate a point. we are making a fishing game and i need to know how to randomize where my fish goes in between every vector input

Comments

RE:randomizing

You need a

Randomize

statement early in your program. This prevents the same sequence of 'random' numbers coming up every time you run the program.

Then to set the position of the fish (xf,yf) you use the rnd function. Say you want the fish somewhere in an area from 1,1 to 100,100.

let xf = int(100*rnd)+1
let yf = int(100*rnd)+1

rnd returns a value between 0 and 1 (but never actually 1).

rwt