Answers for "Random numbers"

9

rng

Random rng = new Random()
rng.Next(min,max)
Posted by: Guest on June-10-2020
7

Random numbers

Random rnd = new Random();
int month  = rnd.Next(1, 13);  // creates a number between 1 and 12
int dice   = rnd.Next(1, 7);   // creates a number between 1 and 6
int card   = rnd.Next(52);     // creates a number between 0 and 51
Posted by: Guest on May-19-2021
3

random number

import random
random = random.randrange(0,10)
Posted by: Guest on May-28-2021
7

random number generator

Random RNG = new Random();
int randomNumber = RNG.Next(x, y) //x is the minimum number, and y is the amount of possible numbers
Posted by: Guest on April-16-2021

Browse Popular Code Answers by Language