Lesson 5.5: Mini-Challenges (Game Jam)

Today’s Goals

  • Practice making small game snippets quickly
  • Combine loops, conditionals, and functions
  • Build confidence by coding multiple short challenges

Warm-Up Question

  • If you had to design a game in 5 lines of code, what would it do?

Challenge 1: Guess the Word

secret = "python"
guess = input("Guess the word: ")
if guess == secret:
    print("You win!")
else:
    print("Try again!")

Challenge 2: Dice Roller

import random
roll = random.randint(1, 6)
print("You rolled:", roll)
  • Modify it so the player can roll twice

Challenge 3: Coin Flip Game

import random
flip = random.choice(["Heads", "Tails"])
guess = input("Heads or Tails? ")
if guess == flip:
    print("Correct!")
else:
    print("Wrong!")

Class Activity

  • Work in pairs or small groups
  • Finish as many mini-challenges as you can in 20 minutes
  • Share your favorite with the class

Student Challenge

  • Invent your own 5–10 line game
  • It must use at least one loop and one conditional

Wrap-Up

  • Today was about creativity and speed
  • Next week: Start Adventure Game project