Random Number Generator

Started by , Fri 09/01/2004 19:55:00

Previous topic - Next topic

Mark C

I need to produce a random number, and then display it on screen. Im aware of the random function but i'm unsure of how to do this particular task. Any ideas, anyone?
Thanks in advance,
Mark C

Ben

You need to declare a variable:

int value = Random(10); //creates a number between 0 and 10

Then you can display it like this:

Display("The value is %i", value); //displays the number stored in "value"

Does that help?

SMF spam blocked by CleanTalk