mardi 18 octobre 2016

better way to make java do random stuff?

Here is the thing. recently I've been working on a project which is kind of a AI like thing. what i want to do is, i will be given a random number between 0-300 and i have to do a random thing based on that number.

now i can use

switch(/*number b/w 0-300*/){
case 0:
case 1:
so on to 300

i have tried IF-Else cases and apparently they are even more inefficient then switch cases.

but i think there must be a better way to do this because it will take like forever to make soo many cases.




Aucun commentaire:

Enregistrer un commentaire