IBM SC34-5764-01 Manual do Utilizador Página 115

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 481
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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
Vista de página 114
1 2 ... 110 111 112 113 114 115 116 117 118 119 120 ... 480 481

Comentários a estes Manuais

Sem comentários