Skip to content

Instantly share code, notes, and snippets.

@ajnadel
Created February 12, 2015 03:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajnadel/8ee5562827c482eff6c9 to your computer and use it in GitHub Desktop.
Save ajnadel/8ee5562827c482eff6c9 to your computer and use it in GitHub Desktop.
hello, goodbye, re = ARGV
print hello
puts " and #{goodbye}"
puts "hello!"
puts "what is up?"
puts "here we go"
# comment lineeee
puts "phew. made it."
puts "2 * 2 = #{2*2}"
puts "3 + 7 / 17^8 = #{3+7/17**8}" #resolves to 3, but is actually 3.0000000000000001
puts "Mary had a little lamb."
puts "Its fleece was white as #{'snow'}."
puts "And everywhere that Mary went."
puts "." * 10 # what'd that do?
end1 = "C"
end2 = "h"
end3 = "e"
end4 = "e"
end5 = "s"
end6 = "e"
end7 = "B"
end8 = "u"
end9 = "r"
end10 = "g"
end11 = "e"
end12 = "r"
# watch that print vs. puts on this line what's it do?
print end1 + end2 + end3 + end4 + end5 + end6
puts (end7 + end8 + end9 + end10 + end11 + end12) *2
puts """Mon
Tues
Wed
Thurs
Fri
Sat
Sundy"""
word = gets.chomp
puts word[1..-1] + word[0] + 'ay'
puts open(ARGV.first).read
print 'Cash: $'
puts gets.chomp.to_f / 10
user_name = ARGV.first
prompt = '> '
puts "Hi #{user_name}."
puts "I'd like to ask you a few questions."
print "Do you like me #{user_name}?\n", prompt
likes = $stdin.gets.chomp
print "Where do you live #{user_name}?\n", prompt
lives = $stdin.gets.chomp
print "What kind of computer do you have?\n", prompt
computer = $stdin.gets.chomp
puts """
Alright, so you said #{likes} about liking me.
You live in #{lives}. Not sure where that is.
And you have a #{computer} computer. Nice.
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment