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
| Empty file |
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 |
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 message | |
| puts "Hello! Welcome to TextCalc 0.7" | |
| # Define calculator function | |
| def runcalc | |
| # Ask for operator | |
| puts "Add, subtract, divide, multiply, or grow exponentially?" | |
| opor= gets.chomp | |
| if opor == "add" then | |
| # Adding | |
| puts "1st Number" |
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 message | |
| puts "Hello! Welcome to TextCalc 0.7" | |
| # Define calculator function | |
| def runcalc | |
| # Ask for operator | |
| puts "Add, subtract, divide, multiply, or grow exponentially?" | |
| opor= gets.chomp | |
| if opor == "add" then | |
| # Adding | |
| puts "1st Number" |
NewerOlder