I have two implementations of a function that prints out a basic board for Tic-Tac-Toe.
Which of these should I include and why?
def display_board(board)
for i in 0...9
print " #{ board[i] }"
if (i+1)%3 != 0
print " |"
elsif i != 9
print " \n#{'-'*11}\n"
end
end
end
def display_board(board)
puts " #{board[0]} | #{board[1]} | #{board[2]} "
puts "-----------"
puts " #{board[3]} | #{board[4]} | #{board[5]} "
puts "-----------"
puts " #{board[6]} | #{board[7]} | #{board[8]} "
end