Pseudocode Help

liunx

Guest
Hi, <br />Im a computing student and need help with some pseudocode. The <br />following is what I have got so far... <br /><br /><br />SET point_value = 10 <br />SET suit_value = Hearts <br />SET point_valueA = suit_valueA = guess_count = game_count = = 0 <br />REPEAT <br />OUTPUT message to operator for suit_valueA <br />GET suit_valueA <br />IF suit_valueA == suit_value THEN <br />OUTPUT message indicates successful guess <br />ELSE <br />OUTPUT message indicates incorrect guess <br />END IF <br />UNTIL suit_valueA == suit_value <br />REPEAT <br />OUTPUT message to operator for point_valueA <br />GET point_valueA <br />IF point_valueA == point_value THEN <br />OUTPUT messages indicates successful guess <br />ELSE <br />IF point_valueA < point_value THEN <br />OUTPUT message indicates guess to low <br />ELSE <br />OUTPUT message indicates guess to high <br />END IF <br />END IF <br />UNTIL point_valueA == point_value <br /><br /><br />The code is for a game which goes by the following rules... <br /><br /><br />1) Imagine computer randomly selects a card from a pack of cards. <br />2) The first player must guess the suit then its value <br />3) After each guess for the suit a message will display whether the <br />player was correct or not. <br />4) After each guess for the value a message will display whether the <br />player was correct, too high or too low. <br />5) The individual game ends when a player has correctly identfied the <br />card, the next player is now given a new card. <br />6) On completing 3 games each the average number of guesses to <br />correctly identify the card should be displayed for each player. <br />7) The game should be restricted to three players. <br /><br /><br />So basically I have completed the first 4 steps but need help editing <br />my code to include rules 5, 6 and 7. <br /><br /><br />Any help at all would be very much appreciated. <br /><br /><br />Many Thanks, <br /><br /><br />Rob.
</div>
 
Top