Skip to content

Instantly share code, notes, and snippets.

@jacknoble
Created December 2, 2013 20:50
Show Gist options
  • Select an option

  • Save jacknoble/7758742 to your computer and use it in GitHub Desktop.

Select an option

Save jacknoble/7758742 to your computer and use it in GitHub Desktop.
duplicate chess board
def dup
board_copy = Board.new
piece_set.each do |piece|
piece.class.new(board_copy, piece.position, piece.color)
end
board_copy
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment