-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhello_ruby.rb
19 lines (15 loc) · 887 Bytes
/
hello_ruby.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# This program is an extension of the "Hello, World!" assignment I created to practice quotation solutions in Ruby.
# The original assignment (per Ada's instructions) can be found in my ada-pushed repository under hello_world.rb.
# Paul McCartney's dialogue contained in single quotes; Ruby's is in double quotes.
# Alternate String Syntax (single and double)
puts "'Hello, Ruby!'"
puts '"Goodbye."'
# Escaped Syntax
puts "'Hello, hello!' I don\'t know why you say \'goodbye;\' I say \'hello.\'"
puts "\"This is getting a little uncomfortable, Paul.\""
# Alternative Syntax for Strings
puts %$'You say "yes." I say "no." You say "stop." I say "go, go, go." You say "goodbye." I say "hello."'$
puts %$"'Aloha,' Paul. Ruby out."$
# Credits:
# "Hello, Goodbye" by The Beatles (1967)
# https://www.digitalocean.com/community/tutorials/how-to-work-with-strings-in-ruby by Brian Hogan