๐ŸŽฎ Lesson 1: Find the Hidden Ship!

โœ… Learning Outcomes

๐Ÿ’ก Why It Matters

Every video game has hidden logic โ€” secret levels, random enemies, or treasure locations. Learning to hide and reveal things with code is the first step to making your own games!

These same skills are used in apps, quizzes, and even smart home devices!

โฑ๏ธ Lesson Plan (40 minutes)

0โ€“5 min โ†’ Demo & Explain
Show the game: โ€œThereโ€™s a secret ship! Can you find it?โ€
Explain: Weโ€™ll write code that hides a ship and checks your guess.
5โ€“20 min โ†’ Code Together
Type this starter code (or use your template):
import random

ship_row = random.randint(0, 4)
ship_col = random.randint(0, 4)

print("Guess the ship!")
guess_row = int(input("Row (0-4): "))
guess_col = int(input("Col (0-4): "))

if guess_row == ship_row and guess_col == ship_col:
    print("๐ŸŽฏ HIT! You sank the ship!")
else:
    print("๐Ÿ’ฆ MISS!")

print("The ship was at", ship_row, ship_col)
    
20โ€“35 min โ†’ Test & Improve
โ€ข Run the program 3 times
โ€ข Try to break it (type a letter instead of number โ€” what happens?)
โ€ข ๐ŸŒŸ Challenge: Add a 2nd ship or limit to 3 guesses!
35โ€“40 min โ†’ Share & Celebrate
Pair up! Can your partner guess the ship in 2 tries?

๐Ÿš€ You Just Learned:

How to create interactive programs that respond to user choices โ€” the heart of all games!