highscore delete function added
parent
eb361a6f58
commit
5379345afa
Binary file not shown.
|
@ -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();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue