Slot machine in javascript