Crazy 8 game in javascript