Reversi CLI game in JavaScript