commiting javascript game rules