Methods for Designing Loops

The method for designing loops is to ask two questions:
  • Will it always end?
  • 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.


loops4.html | Timestamp icon Last updated: Monday, 5 June 2017