This commit is contained in:
nora 2020-12-05 23:22:51 +01:00
parent 73207c6bb2
commit 095fb3ee15

View file

@ -8,7 +8,7 @@ import java.util.ArrayList;
* *
* <p> * <p>
* Every trivia question has 4 answers, giving us a random number out of 4 for every question * Every trivia question has 4 answers, giving us a random number out of 4 for every question
* 2 question can give an octal digit, which can be converted to an int * so now we just use the 4 as two binary digits and use them lol
* 200IQ move, ik * 200IQ move, ik
* </p> * </p>
*/ */
@ -44,11 +44,13 @@ public class GoodRandom {
private int getFourDigit(){ private int getFourDigit(){
trivia.getTrivia(); trivia.getTrivia();
ArrayList<String> answers = new ArrayList<>(); ArrayList<String> answers = new ArrayList<>();
answers.add(trivia.getCorrectAnswer()); String[] inc = trivia.getIncorrectAnswers();
answers.add(trivia.getIncorrectAnswers()[0]); String cor = trivia.getCorrectAnswer();
answers.add(trivia.getIncorrectAnswers()[1]); answers.add(cor);
answers.add(trivia.getIncorrectAnswers()[2]); answers.add(inc[0]);
answers.add(inc[1]);
answers.add(inc[2]);
answers.sort(null); answers.sort(null);
return answers.indexOf(trivia.getCorrectAnswer()); return answers.indexOf(cor);
} }
} }