Skip to content

Our students’ creations

Our students create. Your turn to play!

These games were imagined and programmed by Smart Kids School students. With their permission, we put them online so everyone can play.

Bulls and Cows

Created by Emilien, age 12

Python

How to play

  1. 1The computer picks a secret 4-digit number with all different digits. It never starts with 0.
  2. 2Make a guess. For each digit, the computer gives you a clue.
  3. 3Use your clues to find the secret number in as few guesses as possible.

Bull: right digit, right place

Cow: right digit, wrong place

Example: Secret 1234, guess 1325: the 1 is in the right place (1 bull), the 3 and the 2 are in the secret but in the wrong place (2 cows), the 5 is not in it.

Guess #1

Your guess:

 

Your guesses

Your guesses and their clues will appear here. Compare them to find the secret!

Behind the scenes: Emilien’s code

Emilien wrote this game in Python during his autumn camp. In his version, you play in the terminal and the result is shown as (bulls, cows). We turned it into a web version with buttons, without changing his rules.

What he used

  • Functions (def)
  • While loops
  • If / elif conditions
  • Randomness (randint)
  • Strings
  • Tuples

For parents

Emilien’s code explained, + 3 challenges for your child

Get the free step-by-step guide to the game by email, followed by 3 progressive challenges so your child can improve it in turn.

  • 4 steps of the code, simply explained
  • 3 challenges, from ⭐ to ⭐⭐⭐
  • A hint for every challenge

What if your child built the next game?

One-to-one online classes, from Scratch to Python, with EPFL and ETHZ engineers. Every student learns at their own pace and builds their own projects.