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 sign height, width, color = [] | |
total = 0 | |
sqrfeet = height * width | |
total = sqrfeet * 15 | |
print "Enter your colors seperated with commas: " | |
color = gets.chomp.split(',').trim | |
if color.length > 2 | |
total += color.length * 15 | |
else | |
total += color.length * 10 |
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 shakil_the_dog | |
while true | |
print "Give shakil a command: " | |
input = gets.chomp | |
case input | |
when 'woof' | |
puts "WOOF WOOF WOOF" |
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
[1] pry(main)> def say_hi name | |
[1] pry(main)* print "Hello, #{name}" | |
[1] pry(main)* end | |
=> nil | |
[2] pry(main)> say_hi "Mika | |
[2] pry(main)* " | |
Hello, Mika | |
=> nil | |
[4] pry(main)> x = ['hello','there'] | |
=> ["hello", "there"] |
NewerOlder