Designing a program
Still thinking about method , which is just as important as language , let us take another look at CATMOUSE EXEC.
The program is about a cat and a mouse and their positions in a
corridor. At some stage their positions will have to be pictured on
the screen. The whole thing is too complicated to think about all
at once; the first step is to break it down into:
- Main program : calculate their positions
- Display subroutine : display their positions.
Do forever
call Display
Mouse's move
Cat's move
end
Conclusion