Skip to content

Instantly share code, notes, and snippets.

@djquan
Created September 27, 2013 14:55
Show Gist options
  • Save djquan/6729888 to your computer and use it in GitHub Desktop.
Save djquan/6729888 to your computer and use it in GitHub Desktop.
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