Created
September 13, 2018 18:55
-
-
Save micahlt/2f1995a5c554fefdf736d05b0d79a514 to your computer and use it in GitHub Desktop.
0.7.2 Laser created by micahlt - https://repl.it/@micahlt/072-Laser
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
| # Welcome | |
| puts "TextCalC Light 0.71, forked from @micahlt" | |
| def runit | |
| puts "Enter expression" | |
| prob = gets | |
| prob = prob.split | |
| if prob[1] == "*" then | |
| puts prob[0].to_i * prob[2].to_i | |
| if gets.chomp == "again" then | |
| runit | |
| else puts "Done." end | |
| elsif prob[1] == "/" then | |
| puts prob[0].to_i / prob[2].to_i | |
| if gets.chomp == "again" then | |
| runit | |
| else puts "Done." end | |
| elsif prob[1] == "+" then | |
| puts prob[0].to_i + prob[2].to_i | |
| if gets.chomp == "again" | |
| runit | |
| else puts "Done." end | |
| elsif prob[1] == "-" then | |
| puts prob[0].to_i - prob[2].to_i | |
| if gets.chomp == "again" | |
| runit | |
| else puts "Done." end | |
| elsif prob[1] == "ex" then | |
| puts prob[0].to_i ** prob[2].to_i | |
| if gets.chomp == "again" then | |
| runit | |
| else puts "Done." end | |
| end | |
| end | |
| runit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment