Skip to content
The Chat Archive
DeepSeekdeepseek-v3-0324· DeepSeek LMArena Human Preference 140K

Guess number game in scratch

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Coherecommand-a-03-2025’s answer.
  1. User

    Guess number game in scratch

  2. Assistant

    Here’s a simple Guess the Number Game in Scratch that you can create step-by-step. This game generates a random number, and the player has to guess it within a limited number of tries.


    🎮 Scratch Guess the Number Game

    Difficulty: Beginner
    Time to Build: ~10 minutes

    📌 Step 1: Set Up the Sprites & Backdrop

    1. Delete the default Cat sprite (right-click → delete).
    2. Add a new sprite (e.g., a button or character) for the "Guess" button.
    3. Choose a backdrop (e.g., "Wall1" or "Xy-grid").

    📌 Step 2: Create Variables

    1. Click "Variables" → "Make a Variable" and create:

      • Secret Number (hidden from player)
      • Guesses Left (starts at 5-10)
      • Player Guess (stores the player’s input)

      (Check "For this sprite only" for Secret Number to hide it.)


    📌 Step 3: Initialize the Game

    Add this code to your main sprite (e.g., the "Guess" button):

    when green flag clicked
    set [Secret Number v] to (pick random (1) to (100))
    set [Guesses Left v] to [5]
    say [I'm thinking of a number between 1 and 100. Guess it!] for (2) secs
    

    📌 Step 4: Ask for Player Input

    when this sprite clicked
    ask [What's your guess?] and wait
    set [Player Guess v] to (answer)
    change [Guesses Left v] by (-1)
    

    📌 Step 5: Check the Guess

    Add these conditional blocks after setting Player Guess:

    if <(Player Guess) = (Secret Number)> then
      say [You win! :D] for (2) secs
      stop [all v]
    else
      if <(Player Guess) > (Secret Number)> then
        say [Too high! Try again.] for (1) secs
      else
        say [Too low! Try again.] for (1) secs
      end
    end
    

    📌 Step 6: Handle Game Over

    Add this after the if blocks:

    if <(Guesses Left) = [0]> then
      say (join [Game over! The number was ] (Secret Number)) for (3) secs
      stop [all v]
    end
    

    🎉 Final Touches

    1. Add sound effects (e.g., "pop" for correct guesses).
    2. Customize sprites (e.g., add a celebration animation when the player wins).
    3. Test the game and adjust difficulty (e.g., change the random range or Guesses Left).

    📥 Example Project

    You can remix a working version here:
    🔗 Scratch Guess the Number Template

    (Or search "Guess the Number" in Scratch’s Explore section.)


    🚀 Challenge Ideas:

    • Add a score system (e.g., +10 points per correct guess).
    • Let the player choose difficulty (e.g., 1-50, 1-100, or 1-1000).
    • Use broadcasts to trigger animations.

    Let me know if you’d like help expanding the game! 😊

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.