Last active
August 29, 2015 14:19
-
-
Save karlosmid/69faa9afaaccacc90446 to your computer and use it in GitHub Desktop.
if then elsif logical error
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
destination = ['Earth', 'Moon', 'Mars'] | |
backtrip = [true,false] | |
if destination == 'Earth' | |
cost = 1000000000 | |
elsif destination == 'Mars' | |
cost = 2000000000 | |
elsif destination == 'Moon' | |
cost = 1500000000 | |
elsif backtrip | |
cost = 3000000000 | |
else | |
cost = 4000000000 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment