Homework 5, Candyland

Short Description:

Write a program which will simulate the game of Candyland.

This assignment is worth 100 points.

Goals

When you finish this homework, you should:

Formal Description

The game of Candyland is a game for children who can not read. The game consists of a game board (pictured below), a deck of cards and a set of gingerbread man markers. Players take turns (in order of age) drawing a card from the deck, and moving their gingerbread man marker to the appropriate square on the board.

For a the official set of rules, look here (or a local copy here). These rules apply unless changed in the discussion below.

Traditional Board Spaces:

The standard game board is made up of 136 spaces, each with a color. Normal spaces have a standard color (Red, Purple, Yellow, Blue, Orange, Green) but no name. Some spaces are special and my have a different color. There are four types of special spaces. To color the board,

Cards

The deck of cards indicate player movement. Cards are either normal movement cards or character cards. There is one character card for each character on the board. When a player draws a character card, the player moves to the corresponding character space on the board. In the normal game there are 6 player cards.

Normal movement cards contain either one or two colored squares, always the same color. For example a card may contain one or two blue squares. Only the standard colors (Red, Purple, Yellow, Blue, Orange, Green) are used, there are no Pink cards. In the traditional deck, there are 8 copies of each single color and two copies of each double card, for a total of 6×8+6×2 = 60.

There will be a total of 66 cards. *This differs from the rules*

A player consists of a name and an age.

For the purposes of this assignment, you will support generic board configurations with:

Your program should begin by prompting the user for an input file which contains the game configuration. This file is in the following format:

No square will appear twice in the above list. For the traditional game, the configuration file would be:
136
6
9 Plumpy
18 Mr. Mint
43 Jolly
75 Grandma Nut
96 Princess Lolly
104 Queen Frostine
3
48 Gooey Gumdrops
86 Lost in Lollipop Woods
121 Molasses Swamp
2
5 59 Rainbow Trail
34 47 Gumdrop Pass
4
10 Bob
3 Brett
14 Steve
21 Pat
V
100
For this configuration, you should play a four player game 100 times, in verbose mode. A game in verbose mode will print sufficient information to allow the user to verify that the game is being played correctly. This should include details about a player's turn, including card drawn, start and end position. For silent mode, the results of each game should be printed. Examples of each are below:
Verbose Mode:
Round 1:
   Brett draws a green card.
       Brett moves from space 0 to space 6.
       Turn over
   Bob draws an orange card.
       Bob moves from space 0 to space 5
       Space 5 is the Rainbow Trail, a shortcut.
       Bob moves from space 5 to space 59
       Turn over
   Steve draws Mr. Mint
       Steve moves from space 0 to space 18
       Turn over
   Pat draws a red card.
       Pat moves from space 0 to space 1
       Turn over
    End of round one. The player order is:
       Bob space 59
       Steve 18
       Brett 6
       Pat   1
Round 2:


Silent Mode
Game 1   Bob wins in 32 turns
Game 2   Pat wins in 145 turns
In any case, you should print statistics which include

Required Files

You should submit the following in a tar file: You should not submit

Submission

Please create a tar file containing the files described above. Email this file to danbennett360@gmail.com by class time of the due date.