Skip to content

Instantly share code, notes, and snippets.

@noqcks
Created September 3, 2014 17:49
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 noqcks/b581f6b6071fb52d0891 to your computer and use it in GitHub Desktop.
Save noqcks/b581f6b6071fb52d0891 to your computer and use it in GitHub Desktop.
puts "hello"
"Benjamin".reverse
puts "Hi, {#name}"
def say_hi
print "What is your name: "
name = gets.chomp
puts "Hi, #{name}"
say_hi
def say_hello
puts "Hello, Ben"
end
say_hello
quit
def say_hi(name)
puts "Hey, #{name}!"
end
say_hi("Ben")
"Ben".inspect
12345.inspect
def print_array(input_array)
input_array { |x| puts x }
end
print_array([1,2,3,4,5])
array1 = [1,2,3,4,5]
print_array(array1)
def print_array(input_array)
input_array.collect {|x| puts x}
end
print_array(array1)
Math.sqrt(1282)
Time.now
Array.new(10, 'bee')
include Math
sqrt 64
history
puts Readline::HISTORY.to_a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment