Skip to content

Instantly share code, notes, and snippets.

@MikaAK
Created June 2, 2014 21:16
Show Gist options
  • Save MikaAK/969d6541db76d295d8a4 to your computer and use it in GitHub Desktop.
Save MikaAK/969d6541db76d295d8a4 to your computer and use it in GitHub Desktop.
Interactive Ruby
[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"]
[5] pry(main)> x.join(" ")
=> "hello there"
[12] pry(main)> for i in b do
[12] pry(main)* print Math.sqrt(i)
[12] pry(main)* end
1.02.4494897427831782.82842712474619031.41421356237309512.4494897427831783.02.01.41421356237309512.23606797749979=> [1, 6, 8, 2, 6, 9, 4, 2, 5]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment