We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi there I'm currently working in java code, and i would really like to know how to make so if the USER types STOP in the console the program would exit out.
Thanks
Answers
There is a command exit(); used best with return; as next line
Can you show some code? Do you have the console already?
if(input.equals(„STOP“) {....
Can't remember the code formating. https://paste.ofcode.org/6XjPkMmUsszWRVZDcrwqFJ
I just would like if the user typed STOP in the console the game would exit out and stop :D
inGame=false;
Can you show it in code
would it be like if(input.equals("STOP")){ inGame = false; } ?
String input=keyb.nextLine();
Must be before that
Chrisir Thanks so much!