You will write the pseudocode for a simple game playing system, which plays against a user. Let’s call the program & the user UA (user agent). PA and UA are in a magical world, in which a dragon can appear.
PA and UA both know that they are being watched by a troll. PA and UA know that the troll will give them coins depending on their joint behavior when the dragon appears. If they both do nothing, the troll will think they are nice, animal lovers and will give them each 3 gold coins. If they both draw their swords on the dragon, the troll will think they are stressed out and over-reacting, and give them 1 coin each. However, if the PA draws its sword and the UA does nothing, the troll will think that the PA is very brave and that UA is a coward, and give PA 5 coins, and UA nothing. Similarly, if UA draws its sword and PA does nothing, then the UA will seem brave and get 5 coins, and PA will get nothing.
2007-03-21
15:30:11
·
1 answers
·
asked by
Facilitate
1