Previous topic |
Next topic |
Ada Home Page |
Index
Guess a number
Problem: Think of a number in the range 1 to N.
Reworded:
- given a set of N possible numbers to choose from
- guess a number from the set
- if wrong, guess again.
- continue until the number is guessed successfully
Recursion comes into the "guess again" stage.
- A set of N-1 numbers remains from which to guess.
- This is a smaller version of the same problem.
Previous topic |
Next topic |
Ada Home Page |
Index
c-lokan@adfa.oz.au / 23 Feb 96