Discuss how a computer program might use this graph to play


In the game of Nim, an arbitrary number of chips are divided into an arbitrary number of piles. Each player can remove as many chips as desired from any single pile. The last player to remove a chip wins. Consider a limited version of this game, in which three piles contain 3, 5, and 8 chips, respectively. You can represent this game as a directed graph. Each vertex in this graph is a possible configuration of the piles (chips in each pile). The initial configuration, for example, is (3, 5, 8). Each edge in the graph represents a legal move in the game.

a. Write Java statements that will construct this directed graph.

b. Discuss how a computer program might use this graph to play Nim.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Discuss how a computer program might use this graph to play
Reference No:- TGS02201579

Expected delivery within 24 Hours