Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- crapsMain()
- inputBalance()
- inputBetAmount()
- display gamesPlayed, balance, bet
- WHILE bet <> 0 DO
- Display comeOutRollMessage
- rollDice()
- IF diceTotal = 7 Or diceTotal = 11 THEN
- winGame = true
- ELSE
- IF diceTotal = 2 OR diceTotal = 3 OR diceTotal = 12 THEN
- winGame = false
- ELSE
- diceTotal = point
- Display inactiveMessage, point
- rollDice()
- WHILE diceTotal <> point AND diceTotal <> 7 DO
- rollDice()
- ENDWHILE
- IF diceTotal = point THEN
- winGame = true
- ELSE
- winGame = false
- ENDIF
- ENDIF
- ENDIF
- endOfGame()
- inputBetAmount()
- ENDWHILE
- leaveGame()
- STOP
- -----------------------------------------------------------------------
- endOfGame()
- IF wingame = true
- amountWon = bet * 2
- balance = balance + amountWon
- display winGame, amountWon, balance
- ELSE
- display winGame, bet, balance
- ENDIF
- EXIT
- -----------------------------------------------------------------------
- inputBalance()
- input initialBalance
- WHILE initialBalance <= 0 DO
- display error
- input initialBalance
- ENDWHILE
- balance = initialBalance
- gamesPlayed = 0
- EXIT
- -----------------------------------------------------------------------
- inputBetAmount()
- input bet
- WHILE bet > balance OR bet < 0 DO
- display error
- input bet
- ENDWHILE
- IF bet <> 0
- gamesPlayed = gamesPlayed + 1
- ENDIF
- EXIT
- -----------------------------------------------------------------------
- leaveGame()
- display gamesPlayed
- IF balance > initialBalance
- winnings = balance - initalBalance
- display winnings
- ELSE
- losses = initialBalance - balance
- display initalBalance, balance
- EXIT
- -----------------------------------------------------------------------
- rollDice()
- IF isDieRollInput = True THEN
- Input die1, die2
- ELSE
- die1 = randomInteger(1 - 6)
- die2 = randomInteger(1 - 6)
- ENDIF
- diceTotal = die1 + die2
- display die1, die2, diceTotal
- EXIT
Add Comment
Please, Sign In to add comment