View Full Version : Tutorial for Dink

01-10-2004, 12:09 PM
I made a tutorial for the dink smallwood editor. It may be here (http://www.freewebs.com/gameengines/). You see, right now I can't log into the computer that has it:( ....at least I know some things that I need to put in....such as the moving...Oh, yeah...I also need to know how the random function for varialbes work. Does anyone know?

01-10-2004, 12:43 PM
The command to get a random number is random(int max, plus this); which can be used like this:

int &random = random(10,1);

That creates a local variable &random with a value between 1 and 10.

Or, from the DinkC Reference:

# Category: (none defined)
# Prototype:
# int random( int max, int plus_this );

Random(10,1) would return a number between 1 and 10. Random(5,0) would
return a number from 0 to 4. [Similar] to how C does it.

[The use of "max" as the designator for the first number is misleading.
The random() function is capable of generating any of "max" distinct integer
values, in the range 0 to (max minus 1); then "plus_this" is added to the
generated value to create the return value. The clearest example is
random(2,0), which can generate either of two values, 0 or 1.

More succinct wording courtesy of ManaUser: "<max> is the number of
possible values and <plus_this> is the lowest possible value."

Also note that it is perfectly valid for <plus_this> to be negative.
"Random(5,-2)", for example, generates 2, 1, 0, -1, or -2.]

07-18-2004, 01:16 PM
x.x I think I lost info on how to get it, plus I think I lost it completly...