Puzzle 2 – create an AI bot to guess a number

Step 5 – finding the full date of birth

A linear search can be used to find an item in a list of anything, so long as there's a sensible order for the things in the list.

You just need to get the list of items right.

What if the program could find your date of birth? Not just the month, but the day and the year as well?

  1. This needs 3 different lists: one for months; one for years (but when will you start and end?) and one for days (1 to 31 I suppose)
  2. Then you'd need to work through each list using a while loop. It would probably be easiest to do this three times
  3. And then at the end you can tell the user when their birthday is.
  4. This is a bit more complex and you probably won't get it right first time. Don't worry about that!

Some hints:

Good luck

That's this puzzle done. What else could you use a linear search for?