Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Fri 09/01/2004 19:55:00

Title: Random Number Generator
Post by: on Fri 09/01/2004 19:55:00
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
Title: Re:Random Number Generator
Post by: Ben on Fri 09/01/2004 20:17:58
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?