diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..32c297c Binary files /dev/null and b/.DS_Store differ diff --git a/Battleships/Lesson1.html b/Battleships/Lesson1.html new file mode 100644 index 0000000..cb25f34 --- /dev/null +++ b/Battleships/Lesson1.html @@ -0,0 +1,121 @@ + + + + + + Lesson 1: Battleships in Python! + + + +

๐ŸŽฎ 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!

+ + \ No newline at end of file diff --git a/Battleships/Lesson2.html b/Battleships/Lesson2.html new file mode 100644 index 0000000..13b9103 --- /dev/null +++ b/Battleships/Lesson2.html @@ -0,0 +1,138 @@ + + + + + + Lesson 2: Hunt All the Ships! + + + +

๐Ÿšข Lesson 2: Hunt All the Ships!

+ +
+

โœ… Learning Outcomes

+ +
+ +
+

๐Ÿ’ก Why It Matters

+

Real games donโ€™t end after one guess! They track score, lives, and progress. Learning to manage game state is how you build Pac-Man, Minecraft, or Roblox games!

+

Lists and loops are used in every programming language โ€” from apps to robots.

+
+ +

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

+ +
+ 0โ€“5 min โ†’ Review & Goal
+ โ€œLast time: 1 ship. Today: 3 ships and 10 turns!โ€
+ Show the enhanced game in action. +
+ +
+ 5โ€“20 min โ†’ Upgrade Your Code
+ Edit your Lesson 1 file to this: +
+import random
+
+ships = []
+while len(ships) < 3:
+    r = random.randint(0, 4)
+    c = random.randint(0, 4)
+    if [r, c] not in ships:
+        ships.append([r, c])
+
+print("3 ships hidden! 10 turns to find them all.")
+hits = 0
+
+for turn in range(10):
+    print("\nTurn", turn + 1)
+    guess_row = int(input("Row (0-4): "))
+    guess_col = int(input("Col (0-4): "))
+    
+    if [guess_row, guess_col] in ships:
+        print("๐ŸŽฏ HIT!")
+        ships.remove([guess_row, guess_col])
+        hits += 1
+        if hits == 3:
+            print("๐Ÿ† You win!")
+            break
+    else:
+        print("๐Ÿ’ฆ MISS!")
+
+if hits < 3:
+    print("Game over! You found", hits, "ships.")
+    
+
+ +
+ 20โ€“35 min โ†’ Level Up!
+ โ€ข Test the game (try to win!)
+ โ€ข ๐ŸŒŸ Challenge 1: Let players use A, B, C for rows!
+ row_letter = input("Row (A-E): ").upper()
+ guess_row = ord(row_letter) - ord('A')
+ โ€ข ๐ŸŒŸ Challenge 2: Show how many turns are left! +
+ +
+ 35โ€“40 min โ†’ Play & Reflect
+ Play your friendโ€™s game! What makes it fun?
+ โ€œNow YOU can make games โ€” not just play them!โ€ +
+ +

๐ŸŒŸ Youโ€™re Now a Game Coder!

+

Youโ€™ve learned the core ideas behind almost every game: hidden objects, player input, feedback, and win/lose conditions.

+ + \ No newline at end of file diff --git a/Battleships/battleships-137-main.zip b/Battleships/battleships-137-main.zip new file mode 100644 index 0000000..dd88b54 Binary files /dev/null and b/Battleships/battleships-137-main.zip differ diff --git a/Battleships/lesson_1.py b/Battleships/lesson_1.py new file mode 100644 index 0000000..0eb0f6f --- /dev/null +++ b/Battleships/lesson_1.py @@ -0,0 +1,41 @@ +# BATTLESHIPS - Grade 7 Python Game +# Lesson 2: Full mini-game with 3 ships and turns! + +import random + +# Step 1: Create 3 hidden ships (as a list of [row, col]) +ships = [] +while len(ships) < 3: + r = random.randint(0, 4) + c = random.randint(0, 4) + if [r, c] not in ships: # avoid duplicates + ships.append([r, c]) + +print("3 ships are hidden on a 5x5 grid!") +print("You have 10 turns to find them all.") + +hits = 0 +turns = 10 + +# Step 2: Game loop +for turn in range(turns): + print("\nTurn", turn + 1) + + # Get guess + guess_row = int(input("Row (0-4): ")) + guess_col = int(input("Col (0-4): ")) + + # Check if guess is a ship + if [guess_row, guess_col] in ships: + print("๐ŸŽฏ HIT!") + ships.remove([guess_row, guess_col]) # remove found ship + hits += 1 + if hits == 3: + print("๐Ÿ† You found all ships! You win!") + break + else: + print("๐Ÿ’ฆ MISS!") + +# Step 3: Game over message +if hits < 3: + print("Game over! You found", hits, "out of 3 ships.") \ No newline at end of file diff --git a/Battleships/lesson_2.py b/Battleships/lesson_2.py new file mode 100644 index 0000000..6b34463 --- /dev/null +++ b/Battleships/lesson_2.py @@ -0,0 +1,22 @@ +# BATTLESHIPS - Grade 7 Python Game +# Lesson 1: Find the hidden ship! + +import random + +# Step 1: Create a secret ship location (row 0-4, col 0-4) +ship_row = random.randint(0, 4) +ship_col = random.randint(0, 4) + +# Step 2: Ask the player for a guess (we'll improve this later!) +print("Guess the ship location!") +guess_row = int(input("Row (0-4): ")) +guess_col = int(input("Col (0-4): ")) + +# Step 3: Check if they hit the ship +if guess_row == ship_row and guess_col == ship_col: + print("๐ŸŽฏ HIT! You sank the ship!") +else: + print("๐Ÿ’ฆ MISS! Try again.") + +# Step 4: (Optional) Show where the ship really was +print("The ship was at row", ship_row, "and col", ship_col) \ No newline at end of file