dimanche 9 avril 2017

Random.Next not working? CODE INSIDE

I'm trying to make a random room selector and Random.Next seems to not be working, please help!

List<string> rooms = new List<string>();
rooms.Add(room1);
rooms.Add(room2);   
int index = Random.Next(rooms.Count);
System.Console.WriteLine(rooms[index]);

The systems I am using (I think this may be the problem)

Using System
Using System.Collections.Generic
Using.Collections

Using.Collections is greyed out.




Aucun commentaire:

Enregistrer un commentaire