Created
September 27, 2013 14:55
-
-
Save djquan/6729888 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def render | |
print " " | |
(0..7).each { |column_num| print " #{column_num} " } | |
puts "" | |
board.each_with_index do |row, row_num| | |
print row_num | |
row.each_with_index do |piece, col_num| | |
if invalid_board_moves.include?([row_num, col_num]) | |
print (piece ? piece.render : " ").colorize(background: :white) | |
else | |
print (piece ? piece.render : " ").colorize(background: :blue) | |
end | |
end | |
puts "\n" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment