Skip to content

Instantly share code, notes, and snippets.

@badbabykosh
badbabykosh / hash_of_hashes.rb
Created December 9, 2012 18:28
Attempting to build hash of hashes
def build_virtual_boards_hash(board, player)
virtual_boards_hash = {}
new_board_hash = {}
virtual_board = board.dup
empty_spaces_on_board = virtual_board.grid.select{ |k, v| v == " " }.keys
index_mark = 'VB'+empty_spaces_on_board.length.to_s
while empty_spaces_on_board.length >= 1
empty_spaces_on_board.each do |empty_space_symbol|