Python Programming Introduction
You will follow an outline to create a simplified version of Yahtzee where the computer and a player compete. You may work with one other person in the class, but only if you both work equally on it. Requirements
• Download YahtzeeOutline.py and open in Wing
• Write code according to the outlined comments shown in YahtzeeOutline.py. No credit given if the outline is not followed. Note: The comments serve as instructions, so they are worded a bit differently than how a programmer might write them.
• You are required to follow the coding style guidelines presented thus far in the notes. However, no additional comments are needed other than your name as the author.
• For this simplified version of Yahtzee, only 3 dice are rolled and points are earned for a Yahtzee (all 3 dice have the same value); two of a kind (2 of the 3 dice have the same values); and chance (all dice values are different). The points earned for each roll are tallied onto running totals for both the player and the computer.
• 50 points are earned for a Yahtzee, 25 points for two of a kind, and the sum of all three dice are earned for chance. Note that you will need to create “named constants” for numbers other than 0, 1, or 2 that are used in your program. For example, if a Yahtzee is earned, don’t add on 50, but rather add a named constant such as YAHTZEE_POINTS that stores the value of 50 (e.g. totalPoints += YAHTZEE_POINTS). You will also need a named constant for two of a kind and the number of dice sides. No other named constant is needed.
• The game concludes when the user enters a letter other than “Y” or “y” when prompted if they want to roll again
• Output must match exactly the output shown below; however, your numbers will differ.
• If you wanted to run the program with different point totals for Yahtzee and two of a kind, the program should run correctly by only changing the values stored for those two constants. No other program changes would need to be made.
• Note: This is the first of two projects this semester. On projects I don’t give direct helpful hints like I do
on labs. I do provide clarification as needed, and I can always further explain notes that may pertain to
the project.
Get Free Quote!
292 Experts Online