IBM SC34-5764-01 Manuale Utente Pagina 115

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 481
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 114
Do forever
call Display
Mouse's move
Cat's move
end
Conclusion
Methods for Designing Loops
The method for designing loops is to ask two questions:
v Will it always end?
v Whenever it terminates, will the data meet the conditions required?
Well, the loop terminates (and the game ends) when:
1. The mouse runs to the hole.
2. The mouse runs into the cat.
3. The cat catches the mouse.
The Conclusion
At the end of the program, the user must be told what happened.
call display
say who won
Programming Style and Techniques
Chapter 10. Programming Style and Techniques 93
Vedere la pagina 114
1 2 ... 110 111 112 113 114 115 116 117 118 119 120 ... 480 481

Commenti su questo manuale

Nessun commento