6/29/2019 - One of the first programs I wrote in my intro to C++ class was a craps dice game. You can see the source code for the game here, and the output looked like this:
The rules are simple: You start out with $500 and you make a bet. If you roll a 7 or 11 on the first roll, you win the amount you bet. If you roll a 2 or 12 on the first roll, you lose the amount you bet. If you roll any other number, that number becomes your "target," and you keep rolling until you either roll your target number again (win money) or roll a 7 (lose money). At this point, assuming you still have money, you are asked to bet again, and the process repeats itself until you quit or run out of money.
You can see the source code for the browser version here.
Click here to play the game.
Back to homepage