Skip Navigation Links
AI algorithm for Cluedo game
02 Dec 2022 (62 views)

I spent 1 week to design the artificial intelligence (AI) for the board game called Cluedo.

In the game, you have to find out the person, weapon and place of the murder. There are 6 suspects, 6 possible weapons and 9 rooms.

I have to develop the algorithm for the following:

1. Deal the 21 cards to the 6 players with 3 cards being the actual person, weapon and room of the murder.
2. Simulate the roll of two dice to identify the possible rooms.
3. The AI helps the current player to suggest the suspect, weapon and room, using the data available to the player.
4. The other players will check, in sequence, if the player holds any of the cards suggested by the current player. This stops when one card is shown.
5. The AI marks the clue sheets of the six player, as they are used for future calculations.
6. If the current player has collected sufficient data, the player can make an accusation. This is checked against the actual cards of the murder.

The algorithm is extremely complex. I made many mistakes and could not get the algorithm to work properly. They gave strange results.

Finally, after over 100 attempts, checks and fixes, I managed to get the AI to work properly.

TKL is now an AI expert. Hehehe.
 


AI algorithm for Cluedo game
[Back] [Print]


I spent 1 week to design the artificial intelligence (AI) for the board game called Cluedo.

In the game, you have to find out the person, weapon and place of the murder. There are 6 suspects, 6 possible weapons and 9 rooms.

I have to develop the algorithm for the following:

1. Deal the 21 cards to the 6 players with 3 cards being the actual person, weapon and room of the murder.
2. Simulate the roll of two dice to identify the possible rooms.
3. The AI helps the current player to suggest the suspect, weapon and room, using the data available to the player.
4. The other players will check, in sequence, if the player holds any of the cards suggested by the current player. This stops when one card is shown.
5. The AI marks the clue sheets of the six player, as they are used for future calculations.
6. If the current player has collected sufficient data, the player can make an accusation. This is checked against the actual cards of the murder.

The algorithm is extremely complex. I made many mistakes and could not get the algorithm to work properly. They gave strange results.

Finally, after over 100 attempts, checks and fixes, I managed to get the AI to work properly.

TKL is now an AI expert. Hehehe.