Added check to ensure accuracy is always positive
This commit is contained in:
@@ -32,6 +32,7 @@ int main(int argc, char *argv[])
|
|||||||
correct_guesses.emplace_back(num);
|
correct_guesses.emplace_back(num);
|
||||||
|
|
||||||
accuracy -= abs(user_guess - num) / 100.;
|
accuracy -= abs(user_guess - num) / 100.;
|
||||||
|
accuracy = accuracy > 0 : -accuracy;
|
||||||
num = gen.get_next_num();
|
num = gen.get_next_num();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user