Skip to content

Instantly share code, notes, and snippets.

@dsomel21
Created April 27, 2016 08:18
Show Gist options
  • Save dsomel21/c19cae47f44a2498256fd4db4c76edd4 to your computer and use it in GitHub Desktop.
Save dsomel21/c19cae47f44a2498256fd4db4c76edd4 to your computer and use it in GitHub Desktop.
Interactive Ruby Practice (with Math)
dilraj@TurboGrafix16:~$ pry
[1] pry(main)> Math.sqrt(69)
=> 8.306623862918075
[2] pry(main)> Time.now
=> 2016-04-27 04:15:58 -0400
[3] pry(main)> Array.new(10)
=> [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil]
[4] pry(main)> Array.new(10,"yeezy")
=> ["yeezy",
"yeezy",
"yeezy",
"yeezy",
"yeezy",
"yeezy",
"yeezy",
"yeezy",
"yeezy",
"yeezy"]
[5] pry(main)> include Math
=> Object
[6] pry(main)> sqrt 64
=> 8.0
[7] pry(main)> history
1: Math.sqrt(69)
2: Time.now
3: Array.new(10)
4: Array.new(10,"yeezy")
5: include Math
6: sqrt 64
[8] pry(main)>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment