function beginGame() public payable {
        address player = msg.sender;
        uint bet = msg.value;

        require(player != address(0));
        require(gamesInProgress[player].state == GameState.None || gamesInProgress[player].state == GameState.Finished);
        require(gameRunning);
        require(bet >= minBet && bet <= getMaxBet());

        Game memory game = Game({
                id:         uint(keccak256(block.number, player, bet)),
                player:     player,
                state:      GameState.WaitingForFirstCard,
                bet:        bet,
                firstRoll:  0,
                finalRoll:  0,
                winnings:   0,
                direction:  BetDirection.None
            });

        balanceInPlay = balanceInPlay + game.bet;
        gamesInProgress[player] = game;
        rollDie(player);
    }