binary_guessing_game

Project Description

tI just finished a classic "Guess My Number" project in Snap! and wanted to share the clever math behind it.
🃏 How It Works

    There are 6 cards, each displaying 32 numbers (from 1–63)
    The first number on each card is its "secret value": 1, 2, 4, 8, 16, 32 (powers of 2!)
    The player thinks of a number between 1 and 63
    For each card, they answer: "Is your number here?"
    If yes, the card's secret value is added to a running total
    At the end? 🎉 The total is the player's number!

🔢 Why It Works
Every number from 1–63 has a unique 6-bit binary representation.
Example: 42 = 32 + 8 + 2 → binary 101010 → appears only on cards starting with 32, 8, and 2.
The cards are pre-filtered so a number appears on exactly the cards whose secret values sum to it. No magic—just binary! ✨

Created March 27, 2026

Last updated March 28, 2026

Published March 28, 2026