We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 09118de commit 03e1ae8Copy full SHA for 03e1ae8
src/com/foxelyss/maththemright/Game.java
@@ -144,7 +144,7 @@ public void generateExercise() {
144
145
int operation = random.nextInt(4);
146
147
- double right_result = (double) a / b;
+ int right_result = a / b;
148
149
char operand = '/';
150
switch (operation) {
@@ -169,7 +169,8 @@ public void generateExercise() {
169
170
answers.deleteAll();
171
for (int i = 0; i < 4; i++) {
172
- String answer = (right_result + 1 + random.nextInt(16)) + "";
+ int offset = random.nextInt(24);
173
+ String answer = (right_result + offset < 12 ? -1 * (1 + offset) : offset) + "";
174
if (i == right_answer_index) {
175
answer = "" + right_result;
176
}
0 commit comments