+ 1
How can I make this game (code) correct? When you see the code you will understand what I was trying to do... plz help
6 Answers
0
use:
String y= name[random.nextInt(3)];
random.nextLine does not exist.
+ 1
because you are trying to access name[ ] elements using a random index. and array indexes are of type int.
name[0] name[1] name[2]
+ 1
Bahhađ§ thank you!
0
Are you trying to take a user input and then trying to produce a random word from the array and see who wins the game?
0
Avinesh I made that you can only write (in the Scanner) rock, paper or scissors (like I wrote here, or in capital letters). And then i am trying to make a Random from an array..
0
Bahhađ§ thank you! It worked! But why is it an "int"? Its a word.. shouldn't it be a "nextLine"?