Skip to content

Instantly share code, notes, and snippets.

@joonty
Last active December 19, 2015 22:39
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 joonty/6029349 to your computer and use it in GitHub Desktop.
Save joonty/6029349 to your computer and use it in GitHub Desktop.
Cycle through an array during creation of another array .
options = [:hit, :miss, :unknown].cycle
Array.new(10) { Array.new(10) { |v| options.next } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment