TLP - Programming Maintenance
Week 13 - One roll of Farkle

NOTE: You may work on this with a single partner. Each of you is responsible for submitting the code in your own account on Autolab. Please make sure that the name of both partners is written in a comment block at the top of the code you submit to Autolab.

 

Background

In week 10 we started working with Farkle. This week we are going to continue. As a reminder, a full turn of Farkle for one player goes like this:

  1. A player rolls six dice.
  2. It is highly likely that there will be some dice that score points.  If so
    • The player may quit their turn taking the points earned, or
    • The player may set aside one or more dice that score points and then roll the remaining dice
  3. If at anytime the player has set aside all six dice as scoring dice than they can pick up all six dice and continue scoring points by rolling all six dice.
  4. If at anytime the player rolls N dice and none of those N produce scoring dice than the player loses ALL points accumulated that round and earns a score of 0.

 

If you would like to watch a video with some sample rolls you can watch this video 

While there are multiple scoring schedules for this game, I will ask that you use this one:

Roll Combination Points Scored
Individual 1's 100 points each
Individual 5's 50 points each
Three 1's 1,000 points
Three 2's 200 points
Three 3's 300 points
Three 4's 400 points
Three 5's 500 points
Three 6's 600 points
1-2-3-4-5-6 3,000 points
Three pairs (including 4-of-a-kind and a pair) 1,500 points

 

 

Task