steve-lorenz / wildmagiks

GNU General Public License v3.0
0 stars 0 forks source link

Random number generator #1

Open steve-lorenz opened 6 years ago

steve-lorenz commented 6 years ago

A random number generator to generate integers between 1 - 100. To simulate the D100.

theresasvrcina commented 6 years ago
// Generate a pseudo-random number from 1 to 100.
// rand() % 100 will result in a number 0 to 100
// add 1 to shift the range to get a possible range 1 to 100.
side = 1 + rand() % 100; 
steve-lorenz commented 6 years ago

@theresasvrcina This is great! Depends what we use, python has a random module

import random random.randint(1, 100) Would work in python.

theresasvrcina commented 6 years ago

right right depends what language we use.