{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

assign7 - Exercise 7 The Chinese game of...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Exercise 7 The Chinese game of Tsyan/shi/dzi (picking stones) involves two players and two piles of chips. The two players take turns removing chips from the piles. On their turn, each player must either i) remove any number of chips from either one of the piles or ii) remove the same number of chips from both of the piles. The player who removes the last chip wins. Running the sample executable supplied should clear up any questions. Tsyan/shi/dzi is a game of pure skill. For any given initial position, one of the two players is guaranteed to win provided that they play perfectly. In most cases, the player who moves first should win, but this is not always the case. Some initial positions favour the player who moves second. The sample executable plays a pretty mean game and (unless we've overlooked something) can only be beat if the initial position favours the human player and the human player does not make any mistakes. Your program need not play perfectly, though you are certainly encouraged to make it as clever as you can. The only requirements are
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Ask a homework question - tutors are online