![]() |
Example 20Here's the first attempt at a design for Example 14 again: 1. get information from player 1
Each of these three steps will become a procedure. Let's choose names for them as follows:
|
step | name |
1. get information from player 1 | get_info |
2. get answer from player 2 | get_answer |
3. print appropriate message | message |
|
PROGRAM quiz; {a quiz game} VAR
BEGIN
{main program starts here}
|
|
PROGRAM quiz; {a quiz game} VAR
PROCEDURE get_info;
{information from player 1}
PROCEDURE get_answer;
{answer from player 2}
{the other procedure goes in here} BEGIN
{main program}
|
PROCEDURE message; {print appropriate message}
|
© 1998 John Brewer |