Make a Tiny Game
Every game is rules, input, and a response. You set the rules. Your guess is the input. The page replies. Put them together and you have a real game.
What is a game made of?
Not magic. Just three plain pieces, all written in code.
Rules
What is allowed and how you win. You will set these in a second.
Input
What the player does. Here, that is the number you guess.
Response
What the game says back. Higher, lower, or you won.
A game is rules plus input plus response. The page will hide a secret number. Your job is
to find it. After each guess it answers higher or lower, and counts your tries. All of that is just
code following a rule you can read.
Set the rules
You are the maker now. Pick how hard it is, then give your game a name.
20
The secret will be somewhere from 1 to this number. Bigger means harder.
Up to 28 letters. This shows at the top while you play.
Those two choices are your rules. Real game makers tune numbers like these for hours to
get the difficulty just right. Change them, play, and feel the game change.
Play your game
The page picked a secret number. Type a guess and press Guess. It will tell you higher or lower.
Secret Number Hunt
Secret is from 1 to 20
Make your first guess.
See the three pieces working? Your typed number is the input, "higher or lower" is the
response, and "find the secret in as few tries as you can" is the rule. That is a whole
game, and you just made it.
← The Foundry · This is a real game, built from rules, input, and a response. The next one is yours: dream it up in Mission Control.