Hi everyone,
Good to see you back after the Halloween break.
Last Saturday we did a slightly different game to usual., There was no movement, no sensing when something happened. It was a Maths Game, a guessing game where the computer picks a random number and we had to guess the number.
We had to first make sure that a random number was picked using an Operator. Previously we have used a Variable to store a Score or Lives, but this time it was storing the random number and our guesses. Leaving them on screen as we were testing allowed us to understand more about the variable and what it does…it also made the testing a little easier.
Depending how any guesses we were given we repeated our code that number of times. As well as having to make decisions, i.e If_then, we also had to do a comparison before making the decision, to determine whether the guess was correct, too low or too high.
Some of you tried to add a timer and below is the code you will need if you didn’t get it to work. Take a look and add it to your own game/games.
Here is a link to last weeks notes. cda-s6-week_06-guessnumbers.pdf
See you next week!
Martha