Is there a way in Java that you can redefine an integer that uses the Random Class if user input enters a specific number? I guess what I am trying to say is if there is a way to end the Random class if user enters a certain number?
For example, Say while score is at 5, if userInput == 3, computerNum (which previously generated random numbers now) == a specific number designated to perform an action if userInput is greater than computerNum.
(Just started learning Java a week ago so I am trying to learn as much as I can haha. Don't have any code that uses my example unfortunately, I am wanting to do some research before I try something that uses this. )
Any help is much appreciated!
Aucun commentaire:
Enregistrer un commentaire