I have to program the game cluedo for a project; my problem is in in the phase of selecting the 3 cards that will be the killer, the weapon and the place. Then group all the cards and give them randomly the the players (between 3-6 selected by the user).
The idea I have is to create 3 sets (1 of each kind) so I can select randomly 1 of each set to determine the killer, the weapon and the place.
Next, create a 4th set with the union of the other 3 ( giving the idea of mixing all the cards), exclude the 3 elements previously chosen and do a loop assigning each card to the hand of the player(I think the hand should be an array and this must be done evenly).
Note that the assignment of the cards must be without repetitions , so I guess I have the exclude the chosen card in the loop from the 4th set each round).
Also there are 6 persons cards, 6 arms and 9 places.
Could someone give me insight of how to write this section of the game in Pascal?.
0 · ·