Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static String highscorFile = System.getenv("USERPROFILE") + "/Desktop/Snake_Highscore.txt";
- private String GetHighscore() throws IOException {
- File file = new File(highscorFile);
- String j = "";
- if (file.exists()) {
- Scanner scanner = new Scanner(file);
- while(scanner.hasNextLine()) {
- String zeile = scanner.nextLine();
- if (zeile.equalsIgnoreCase("")
- || zeile == null) {
- break;
- }
- j = zeile;
- }
- scanner.close();
- return j;
- }
- return "0";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement