Skip to content

Instantly share code, notes, and snippets.

@hakusaro
Created July 10, 2018 16:52
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 hakusaro/c5eecf45c3b8abf3e8bf80d712f93c8c to your computer and use it in GitHub Desktop.
Save hakusaro/c5eecf45c3b8abf3e8bf80d712f93c8c to your computer and use it in GitHub Desktop.
[1] pry(main)> dr = Array.new(3, Array.new(3, "f"))
=> [["f", "f", "f"], ["f", "f", "f"], ["f", "f", "f"]]
[2] pry(main)> dr[0][0] = "x"
=> "x"
[3] pry(main)> dr
=> [["x", "f", "f"], ["x", "f", "f"], ["x", "f", "f"]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment