row 1 * * * * *
row 2 * * * * *
row 3 * * * * *
For a turn a player may remove as many candies as she likes from any one row, but she must remove at least one candy.
Sample Game:
row 1 * * * * *
row 2 * * * * *
row 3 * * * * *
Player 1 removes 2 candies from row 1
row 1 * * *
row 2 * * * * *
row 3 * * * * *Player 2 remove 3 candies from row 3
row 1 * * *
row 2 * * * * *
row 3 * *
Player 1 remove 3 candies from row 1
row 1
row 2 * * * * *
row 3 * *
row 1
row 2 *
row 3 * *Player 1 remove 1 candy from row 2
row 1
row 2
row 3 * *
Player 2 remove 2 candies from row 3
row 1
row 2
row 3and wins !!!
Your job is to write a program that has the computer play Candy Trail with a human. Start out by playing the game several times with friends. Provide a nice display and a clear user interface. This is an exercise in breaking a large task into smaller ones - writing functions. Think about what information a particular function needs from main, and what information should be changed as a result of the function. One function may call another function.
Some possible functions to build:
A function that draws the Candy Trail with the current number of candies
in each row.
A function that serves as a dialogue, asking the user about his/her
turn.
A function for that computes the computer's turn. This may call
other functions.
A function to perform the set up functions, describing the game, deciding
who goes first.
Of course you may use other functions either in addition to or instead
of these.