diff --git a/src/main/java/game/runGame.java b/src/main/java/game/runGame.java index 3f0fb1e..954dfc8 100644 --- a/src/main/java/game/runGame.java +++ b/src/main/java/game/runGame.java @@ -7,25 +7,28 @@ import java.io.IOException; public class runGame { public static String QuestionsPath = "QandA/Questions.txt"; public static String AnswersPath = "QandA/Answers.txt"; + public static int lines; public void run() { CountFileLines(QuestionsPath); readFile(QuestionsPath); } - public long CountFileLines(String Path) { + public int CountFileLines(String Path) { try { BufferedReader reader = new BufferedReader(new FileReader(Path)); - + while (reader.readLine() != null) { + lines++; + } } catch (IOException e) { e.printStackTrace(); } - return 0; + return lines; } public static String[] readFile(String Path) { BufferedReader reader; - String[] Arr = new String[6]; + String[] Arr = new String[lines]; try { reader = new BufferedReader(new FileReader(Path)); String line = reader.readLine(); diff --git a/target/MiniGameProject-1.0-SNAPSHOT.jar b/target/MiniGameProject-1.0-SNAPSHOT.jar index 8791b16..279db4f 100644 Binary files a/target/MiniGameProject-1.0-SNAPSHOT.jar and b/target/MiniGameProject-1.0-SNAPSHOT.jar differ diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties index 7452515..e59005d 100644 --- a/target/maven-archiver/pom.properties +++ b/target/maven-archiver/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven -#Fri Dec 30 11:45:27 CET 2022 +#Fri Dec 30 12:02:39 CET 2022 groupId=MiniGameProject artifactId=MiniGameProject version=1.0-SNAPSHOT