Can some help me with a random between two choices ?

Something like:

L = random(A, B);

and in L to have A or B.

Thx.

Featured Replies

- 1
Here's how to do it: [code=cplusplus] int choices[2] = {2,3}; //choose between 2 and 3 // Seed the random generator with srand() // Use rand() to pick either 0 or 1 and store in variable x int L = choices[x]; [/code] Google for srand() and rand() to find out how … Read More

This topic has been dead for over six months. Start a new discussion instead.

Recommended Topics