Skip to content

Commit

Permalink
Create Console.java
Browse files Browse the repository at this point in the history
  • Loading branch information
RonaZong committed Oct 22, 2020
1 parent 31f4788 commit 2718bc7
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions 1DV607/src/DiceGame/View/Console.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package DiceGame.View;

public class Console extends BaseConsole implements IView {

@Override
public boolean wantsToPlay() {
return getInputChar() != 'q';
}

@Override
public void displayResult(boolean win) {
if (win) {
System.out.println("You win!");
} else {
System.out.println("Sorry, you lost...");
}
}

public void displayWelcome() {
System.out.println("Dice Game");
}

public void displayInstruction() {
System.out.println("Press any key to play\n" + "Press 'q' to quit");
}


}

0 comments on commit 2718bc7

Please sign in to comment.