Simple Gomoku in JS