diff --git a/bin/facade/YahtzeeGame.class b/bin/facade/YahtzeeGame.class index 4099096..9836209 100644 Binary files a/bin/facade/YahtzeeGame.class and b/bin/facade/YahtzeeGame.class differ diff --git a/src/facade/YahtzeeGame.java b/src/facade/YahtzeeGame.java index ee20936..5e09331 100644 --- a/src/facade/YahtzeeGame.java +++ b/src/facade/YahtzeeGame.java @@ -1,6 +1,8 @@ package facade; import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; import java.io.PrintWriter; import java.time.LocalDate; import java.util.ArrayList; @@ -111,7 +113,7 @@ public class YahtzeeGame { return highscores; } - public void setScoreToHighscores(int player, String highscores[][]) throws FileNotFoundException { + public void setScoreToHighscores(int player, String highscores[][]) throws IOException { String highscoreMem1 = ""; String highscoreMem2 = ""; @@ -321,7 +323,7 @@ public class YahtzeeGame { } } - PrintWriter out = new PrintWriter("src/csv/highscores.csv"); + PrintWriter out = new PrintWriter(new FileWriter("src/csv/highscores.csv", false)); for (int i = 0; i < 10; i++) { for (int s = 0; s < 3; s++) { @@ -360,4 +362,14 @@ public class YahtzeeGame { return sb.toString(); } + + public void deleteHighscores() throws IOException{ + + PrintWriter out = new PrintWriter(new FileWriter("src/csv/highscores.csv", false)); + + out.println(""); + + out.close(); + + } } diff --git a/src/ui/TUI.java b/src/ui/TUI.java index d9ecb19..7e3c31a 100644 --- a/src/ui/TUI.java +++ b/src/ui/TUI.java @@ -1,5 +1,26 @@ package ui; +import java.util.Scanner; + public class TUI { + public static void main(String[] args) { + + boolean choice = true; + Scanner df = new Scanner(System.in); + + System.out.println("Yahtzee Star Wars Special!"); + + while (choice) { + + System.out.println("Main menu:\n"); + System.out.println("Play"); + System.out.println("Highscores"); + + if(High) + + } + + } + }