randomly playing machine opponent, checking of game end conditions