diff --git a/QandA/Answers.txt b/QandA/Answers.txt index e69de29..f45bc92 100644 --- a/QandA/Answers.txt +++ b/QandA/Answers.txt @@ -0,0 +1,2 @@ +187m,301m,69m,300m +erkentnisse gewinnen,zur ainsicht gelangen,eine leere ziehen,erfarungen sammeln \ No newline at end of file diff --git a/QandA/Questions.txt b/QandA/Questions.txt index da4edb4..385a533 100644 --- a/QandA/Questions.txt +++ b/QandA/Questions.txt @@ -1 +1,2 @@ -Wie hoch ist der Eifelturm? \ No newline at end of file +Wie hoch ist der Eifelturm? +Wurden alle Bierflaschen ausgetrunken, kann man aus dem Kasten nur noch ...? \ No newline at end of file diff --git a/src/main/java/game/runGame.java b/src/main/java/game/runGame.java index 3be5902..27d7736 100644 --- a/src/main/java/game/runGame.java +++ b/src/main/java/game/runGame.java @@ -12,11 +12,17 @@ public class runGame { public static int lines = CountFileLines(QuestionsPath); public static String[] arrQuestions = readFile(QuestionsPath); public static String[] arrAnswers = readFile(AnswersPath); + public static String[] splitAns; public void run(int i) { + splitAns = SplitAnswers(arrAnswers, i); GameGui.QuestionLabel.setText(arrQuestions[i]); - + GameGui.AnswersBtn1.setText(splitAns[0]); + GameGui.AnswersBtn2.setText(splitAns[1]); + GameGui.AnswersBtn3.setText(splitAns[2]); + GameGui.AnswersBtn4.setText(splitAns[3]); + GameGui.questionNr++; } public static int CountFileLines(String Path) { int Numlines = 0; @@ -25,10 +31,12 @@ public class runGame { while (reader.readLine() != null) { Numlines++; } + reader.close(); } catch (IOException e) { e.printStackTrace(); } - return Numlines; + + return Numlines+1; }