I Haz Codes

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Menu
Presence check

Learn

Condition controlled loops will not run a predictable number of times and tend to be controlled by the user. This is ideal for presence checks because we have no idea how many mistakes the user will make.

Try

Write a secret number guessing game. The program will pick a random number from 1 to 100 and then give the user 10 chances to get it right. The program will report if the guess was too large, too small or correct.

The code needs to perform a presence check on the input.

Part of the code has been produced for you.

Task to try

Using your solution from the previous lesson, try and add a presence check on the input.

Challenge task

Using your solution from the previous lesson, try and add a presence check on the input.

Comments are closed.

Information