The Programming Giant Panda

Logo

A tutorial on how to design and code a board game

Who Done It?

by Andi McLean

The game is played with a number of cards separated into Characters, Places, and Weapons.

Murder Pool Cards

Characters

There are eight Suspects (players 1 - 8, we may want to give them names later). One of the players is randomly chosen to be the murderer.

Places

There are eight Places (places 1- 8, we may want to give them names later). One of the places is randomly chosen to be where the murder took place.

Weapons

There are eight weapons (weapons 1-8, we may want to give them names later). One of the weapons is randomly chosen to be the murder weapon.

Dealing

Once the random cards are chosen they are kept hidden, then the rest of the cards are shuffled and then dealt between the players. Then one of the players is randomly chosen to start.

A players go

The current player chooses a suspect, a weapon, and a place and asks the other players if they have any of the cards. The next player checks their cards and if they have one or more of the cards, shows the current player that card. The rest of the players do not get to see the card offered but know a card has been shown. If the next player does not have any of the cards then, it goes to the player after and so on until all players have had a go at showing. If on one has a card then it must be in the Murder pool cards.

Finishing a player’s go.

Making an accusation.

If a player believes they’ve worked out who, where, and how the murder took place, they select the cards that make up their guess and make an accusation. If they are correct then they win the game, else they are out of the game and continue only to show their guesses. (We may want to automate this)

Pass to the next player.

If the current player doesn’t want to make an accusation, then the play goes to the next player.

Finishing the game.

The game finishes when either a player guesses correctly or every player has made a guess incorrectly. In the latter case, the game is a draw.

Main page Lesson 1