-
-
Save HoyaBoya/10130817 to your computer and use it in GitHub Desktop.
Print "helloworld" with the following if/else statement.
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
# PROBLEM | |
# Find an implementation of "x" that will force the code below to print "helloworld". | |
# SOLUTION | |
# This doesn't work with threads forked to return true/false. The trick is to just have x do both. | |
def x | |
print "hello" | |
false | |
end | |
if x | |
print "hello" | |
else | |
print "world" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment