CS Unplugged activity
Battleships: Searching
You and a partner will hunt for a number two ways: checking ships one at a time, then jumping to the middle of a sorted row. Count your shots to see which way is faster.
Player A’s sheet
Keep this sheet hidden from Player B.
- The ships on this sheet are yours. When Player B calls a letter, read them the number under it.
- Take turns. On your turn, call one of Player B’s letters to hunt for your target number. Each letter you call is one shot.
- Write down every letter you call, and stop when you find the target.
Round 1: ships in random order.
Your target: the ship worth 82 on Player B’s sheet. Letters you call: Shots:
Round 2: the same ships, sorted smallest to largest. Player B’s are sorted too, so don’t start at A. Call the middle letter, C. If that number is too small, your target is to the right; too big, to the left. Keep jumping to the middle of what’s left.
Same target, 82. Letters you call: Shots:
After you play: which round took fewer shots? Why did sorting help?
Player B’s sheet
Keep this sheet hidden from Player A.
- The ships on this sheet are yours. When Player A calls a letter, read them the number under it.
- Take turns. On your turn, call one of Player A’s letters to hunt for your target number. Each letter you call is one shot.
- Write down every letter you call, and stop when you find the target.
Round 1: ships in random order.
Your target: the ship worth 24 on Player A’s sheet. Letters you call: Shots:
Round 2: the same ships, sorted smallest to largest. Player A’s are sorted too, so don’t start at A. Call the middle letter, C. If that number is too small, your target is to the right; too big, to the left. Keep jumping to the middle of what’s left.
Same target, 24. Letters you call: Shots:
After you play: which round took fewer shots? Why did sorting help?
Answer key
Player A hunts on Player B’s ships. Target: 82.
- Round 1 (random order): the target is under letter E. Calling every letter in order takes 5 shots.
- Round 2 (sorted): the target is under letter F. Jumping to the middle each time takes 3 shots.
Player B hunts on Player A’s ships. Target: 24.
- Round 1 (random order): the target is under letter E. Calling every letter in order takes 5 shots.
- Round 2 (sorted): the target is under letter B. Jumping to the middle each time takes 3 shots.
Version history
- Loading commit history…