Skip to content
Snippets Groups Projects
Commit 185ba2b3 authored by Martin Schmollinger's avatar Martin Schmollinger
Browse files

Changed Scanner usage

parent 11518b6d
No related branches found
No related tags found
No related merge requests found
...@@ -48,10 +48,8 @@ public class GuessGameApp { ...@@ -48,10 +48,8 @@ public class GuessGameApp {
} }
GAME_LOOP: GAME_LOOP:
while(true) { while(true) {
System.out.print("Enter your guess (0-9): "); System.out.print("Enter your guess (0-9): ");
String number = console.nextLine(); toServer.write(console.nextInt());
toServer.write(Integer.parseInt(number));
serverCode = fromServer.read(); serverCode = fromServer.read();
switch(serverCode) { switch(serverCode) {
case CORRECT_GUESS: case CORRECT_GUESS:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment