A partial clone of the Dots game in JavaScript