parent
84862cf3ba
commit
ed299fbf16
|
@ -1,6 +1,9 @@
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
|
public static final String ANSI_RESET = "\u001B[0m";
|
||||||
|
public static final String RED = "\u001B[31m";
|
||||||
|
public static final String GREEN = "\u001B[32m";
|
||||||
static Scanner keyboard = new Scanner(System.in);
|
static Scanner keyboard = new Scanner(System.in);
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
@ -20,12 +23,12 @@ public class Main {
|
||||||
|
|
||||||
// if (hand.isBlackJack()){
|
// if (hand.isBlackJack()){
|
||||||
if (game.isHandBlackJack()){
|
if (game.isHandBlackJack()){
|
||||||
nextRoundPrompt = "Glückwunsch, sie haben einen BlackJack und damit gewonnen!";
|
nextRoundPrompt = GREEN + "Glückwunsch, sie haben einen BlackJack und damit gewonnen!" + ANSI_RESET;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (hand.isOvershot()){
|
// if (hand.isOvershot()){
|
||||||
if (game.isHandOvershot()){
|
if (game.isHandOvershot()){
|
||||||
nextRoundPrompt = String.format("Leider verloren, der Wert der Hand ist mit %d höher als 21.", game.handValue());
|
nextRoundPrompt = String.format(RED + "Leider verloren, der Wert der Hand ist mit %d höher als 21." + ANSI_RESET, game.handValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextRoundPrompt.isEmpty()) {
|
if (nextRoundPrompt.isEmpty()) {
|
||||||
|
@ -49,7 +52,7 @@ public class Main {
|
||||||
boolean newRoundDecision = yesNoDecider(newRoundPrompt);
|
boolean newRoundDecision = yesNoDecider(newRoundPrompt);
|
||||||
|
|
||||||
if (!(newRoundDecision)) {
|
if (!(newRoundDecision)) {
|
||||||
System.out.println("Auf Wiedersehen :)");
|
System.out.println(RED + "Auf Wiedersehen :)" + ANSI_RESET);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
game = new BlackJackSpiel();
|
game = new BlackJackSpiel();
|
||||||
|
|
Loading…
Reference in New Issue