lundi 27 novembre 2017

How can a generate an array of 5 random, single digit (0-9) integers?

I am developing a game that gets the user to crack a vault code.

int [] vault = {1,2,3,4,5};

I currently just have per-determined values for the vault code (above) but I think it would be best if they changed with each play-through of the game.

I have seen the math.random method but I'm unsure how to make it only display integer values.




Aucun commentaire:

Enregistrer un commentaire