Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Quiz.kt #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lesamouraipourpre
Copy link

Using increment and decrement in a condition check is dubious, but in this case it will never match a value of one below the correct answer.
Also, correct answers should be immutable.

Using increment and decrement in a condition check is dubious, but in this case it will never match a value of one below the correct answer.
Also, correct answers should be immutable.
@CLAassistant
Copy link

CLAassistant commented Sep 22, 2020

CLA assistant check
All committers have signed the CLA.

@@ -30,7 +30,7 @@ fun main() {
// Question 2
if (studentAnswer2 == quizAnswer2) {
points += 25
} else if (studentAnswer2 == quizAnswer2++ || studentAnswer2 == quizAnswer2--) {
} else if (studentAnswer2 == quizAnswer2+1 || studentAnswer2 == quizAnswer2-1) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicking: I think you should add the space to make it clean
studentAnswer2 == quizAnswer2 + 1 || studentAnswer2 == quizAnswer2 - 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants