Monday, January 6, 2014

Aww Craps!

Summary:
This assignment was to make a program that simulates the game craps. First of all, it imports the Dice rolling program from earlier, and takes the various Dice rolls from that. Then based on the sum of those rolls it determines the result of what would happen in a game of craps. If the roll is not one that would initiate point mode, then the player instantly wins. But if it is not an instant win roll, point mode is activated. When point mode is activated the player tries to roll the number that initiated point mode, before rolling an 7 or 11. Then the player is asked if they want to roll again, and if they do the program restarts.
Issues:
Originally I went for the brute force method, with the intent of saving mental effort at the exchange of a bit of time. All that time amounted to nothing, and I wound up restarting and going with the point mode method that I have now. Another issue was getting the program to roll more than once, but I managed to get it working by reloading the dice program after any roll was completed.
Profit:
This project was great for putting all of our skills together, as well as learning how to import our own previous programs as modules. Importing our own programs as modules comes back often in future programs.

No comments:

Post a Comment