OpposableThumbs/Clue Algorithm

< OpposableThumbs

212,771pages on
this wiki
Add New Page
Add New Page Discuss this page0


This describes the C++ classes ClueGame, ClueHand and ClueUtil which are the core of a clue game program.

See Wikipedias's Cluedo for a description of the board game.

Hand Descriptions

In clue there are 21 cards. Because I can fit 21 bits easily within a 32-bit int, I'll use the bits of an int to store each hand. I'm assuming ints to be 32 bits or larger (well, 21 bits, but that's silly). Since we're trying to identify what cards may exist in other people's hands, or within the Solution envelope, I like the idea of any specific card being represented bit a bit position.

bit: 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Also on Fandom

Random wikia