EA Sports called your office. They want you to design their next game.

What you will learn:

  • Primarily
    • If activity
    • While activity
  • Secondarily:
    • Integer and string variables
    • Assign activity

Client name:
EA Sports

Process Name:
Guessing Game

Create a game that:

  • Assign a “secret” integer variable between 1-100
  • Take a user input (a number between 1-100)
  • Check if the user input equals the secret variable
  • If yes the user wins
  • Else ask for a new number (and tell the user, if the guess was too high or too low)

This Post Has 3 Comments

  1. Kuat

    It was possible to do without the second assign, and instead specify the immediately converted variable intUserInput in If body.

    1. Anders Jensen

      Hey Kuat. Thanks for the feedback. And sure a lot of the things can be done with fewer actions, but I specify them out in order to explain in the best way. Kind regards, Anders

  2. Kay

    Hi, Anders,

    Why do we not need an Assign after the initial Input? In other words, how can we set the If condition to assess intUserInput when it hasn’t even been assigned until after the first If loop?

    Thanks for your help in advance!

Leave a Reply