This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var x = 4; | |
if (x == 4) { | |
console.log("Correct!"); | |
} else { | |
console.log("Incorrect!"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if x == 5: | |
print("Correct!") | |
else: | |
print("Incorrect!") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def date_night? | |
Date.today.wday == 5 # is today the weekday 5 out of 7? | |
end | |
def bitcoin_price | |
Bitcoin.get_current_price | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def addition_problem(user_answer, correct_answer) | |
if user_answer == correct_answer | |
alert "Correct!" | |
else | |
alert "Incorrect!" | |
end | |
end | |
# question 1, answer: 4 | |
addition_problem(3, 4) # returns 'false' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = 3 | |
y = 3 | |
x == y # => returns 'true' | |
x = 4 | |
y = 5 | |
x == y # => returns 'false' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if x == y | |
alert "Correct!" | |
else | |
alert "Incorrect!" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# question 1, answer: 4 | |
if 2 + 2 == x | |
alert "Correct!" | |
else | |
alert "Incorrect!" | |
end | |
# question 2, answer: 11 | |
if 4 + 7 == x | |
alert "Correct!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if 2 + 2 == x | |
alert "Correct!" | |
else | |
alert "Incorrect!" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 + 2 == x | |
# what is x? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if 2 + 2 == x | |
alert "Correct!" | |
end |