Created
September 3, 2014 17:49
-
-
Save noqcks/b581f6b6071fb52d0891 to your computer and use it in GitHub Desktop.
This file contains 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
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