And and or…and RANDOMNESS

Slides:



Advertisements
Similar presentations
Introduction to TouchDevelop
Advertisements

Scratch Programming Session 6 of 10 If-then-else statements interactions Final projects specifications.
Mr. Wortzman. Tabs (Block Categories) Available Blocks Script Area Sprite Stage All sprites in this project.
Scratch Internet- Open Chrome hit “Create” 1.
In.  This presentation will only make sense if you view it in presentation mode (hit F5). If you don’t do that there will be multiple slides that are.
Algorithms In general algorithms is a name given to a defined set of steps used to complete a task. For example to make a cup of tea you would fill the.
Timers Exploring Computer Science Lesson Objectives The students will be able to: Create a timer.
We will be creating a spaceship that simulates real movements in space. The spaceship will fire a laser beam that can destroy targets. The spaceship will.
Exploring Computer Science 2/23/15 2/23 Develop a Scratch story project -Brainstorming 2/24 Develop a Scratch story project –Developing 2/25 Develop a.
Section 2 Variables National 4/5 Scratch Course. What you should know after this lesson What a variable is Where variables are stored How to get data.
Exploring Computer Science 2/16/15
My Scratch Story Exploring Computer Science Lesson 4-7.
Learning the skills for programming Advanced Visual Programming.
Exploring Computer Science 2/9/15 2/9Moving Scratch 2/10Moving Scratch worksheet 2/11 Scratch Baseball Game 2/12Scratch Alphabet Learning Game 2/13Game.
Exploring Computer Science 2/2/15 2/2No School 2/3Scratch creating a program- Name 2/4 Scratch creating a program Dialogue 2/5 Scratch creating a dialogue.
Moving Sprites in Scratch Exploring Computer Science – Lesson 4-4.
Variables. Todays Lesson  In todays lesson you are going to:  Learn to use variables  Learn to ask for user input  Learn to save the users response.
Scratch Dialogues Exploring Computer Science – Lesson 4-3.
Variables and Random Numbers Computer App Session 4.
Programming a Shooter Game Design.
How to create a basic game in Scratch. The Scratch Stage The Scratch stage is 480 pixels wide and 360 pixels high x increasesx decreases.
Moving Sprites in Scratch Exploring Computer Science – Lesson 4-4.
Randomising the behaviour of Sprites Games Programming in Scratch.
Today's Ninja Challenge: Write Your First Computer Game!
Making a Flappy Birds Game PART 2 – MAKING THE BIRD FLAP AND FALL – AND DEVELOPING THE GAME FURTHER (ADDING ADDITIONAL CHARACTERS, GOODIES, ENEMIES AND.
Madlib-Input, Strings, and Lists in Scratch Barb Ericson Georgia Tech.
Introduction to Programming with Scratch Exploring Computer Science – Lesson 4-1.
Randomness Exploring Computer Science Lesson 4-10 – Part 2.
Objective of the lesson Use Blockly to make a dice for Snakes and Ladders All of you will: – Make an image which displays when you press a button Most.
Event Driven Programs Exploring Computer Science – Lesson 4-5.
Movement Game Design (Scratch).
Recap: If, elif, else If <True condition>:
Games Programming in Scratch
Madlib-Input, Strings, and Lists in Scratch
© A+ Computer Science -
Exploring Computer Science Lesson 4-7
Spanish Mad libs with Scratch
Exploring Computer Science – Lesson 4-5
Exploring Computer Science Lesson 4-13
Intro CS – Probability and Random Numbers
Exploring Computer Science Lesson 4-14
Randomising the behaviour of Sprites
Exploring Computer Science Lesson 4-10 – Part 1
BBC Microbit.
BBC Microbit.
Scratch Programming Intro
Learning Objective LO: We’re learning to understand when it is appropriate to use particular data types.
Module 5 Lesson 3 Extreme Scratch Cards
Exploring Computer Science Lesson 4-14
EXPLORING COMPUTER SCIENCE
BBC Microbit.
Moving Sprites in Scratch
Exploring Computer Science Lesson 4-13
Year 2 (National Numeracy Strategy) (Based on DFEE Sample Lessons)
Exploring Computer Science – Lesson 4-5
Equivalent Expressions
Exploring Computer Science – Lesson 4-3
Conditionals Exploring Computer Science Lesson 4-9.
Programming Final Project
Exploring Computer Science Lesson 4-7
Getting Started with Scratch
Exploring Computer Science Lesson 4-8
Game Over Module 4 Lesson 2.
Exploring Computer Science Lesson 4-12
Exploring Computer Science Lesson 4-10 – Part 2
Exploring Computer Science Lesson 4-14
Exploring Computer Science Lesson 4-13
Exploring Computer Science Lesson 4-12
Exploring Computer Science Lesson 4-8
Exploring Computer Science Lesson 4-10 – Part 1
Presentation transcript:

And and or…and RANDOMNESS Exploring Computer Science Lesson 4-10

Objectives The students will be able to: Use conditionals with And and Or to write a grade program. Use a random number generator to write a dice program. Objectives

What’s the difference between AND and OR What’s the difference between AND and OR? Give a GENERAL explanation of the difference. Give an example of each and explain how the meaning changes. Discussion

In an AND condition, both parts must be true for the statement to be true.

In an OR condition, the statement is true if either of the parts are true.

AND and OR Blocks in Scratch AND and OR blocks are in Operators. Each side of the operation must be a conditional expression. AND and OR Blocks in Scratch

Let’s check out some code! What do you think this code does? Let’s check out some code!

Crazy High School Grade Program Your task is to make a Scratch program that will tell you a letter grade based on a percentage. Choose a sprite. Create a variable called ‘Grade’. Double click Grade to display the slider. When the green flag is clicked, the program should look at the value of Grade and the sprite should respond with a statement saying what letter grade corresponds to the slider value…as follows: A: greater than 89 B: greater than 79 and less than 90 C: greater than 69 and less than 80 D: greater than 59 and less than 70 F: less than 60 Extra Credit - At Crazy High School, students only qualify for tutoring if they have a B OR a D. After the sprite says the grade, make your program say, “You qualify for tutoring” if the grade is a B or D. You must use a single “if” block to decide if tutoring is needed. Crazy High School Grade Program

Now onto Randomness…

What does the word ‘random’ mean in English? Use it in a sentence. What’s a ‘random number generator’? Check out this website: https://andrew.hedges.name/experiments/random/ What’s Andrew’s answer to complaints that his generator isn’t ‘random’ enough? When might you want to generate one or more random numbers? Exemplify and explain. Opener

If I roll a pair of dice, will the numbers come out in order (2, then 3, then 4 the next roll, etc.)? Randomness

Randomness This unpredictability is called randomness. Randomness can make games more exciting. For example, how many spaces will I get to move this turn? Randomness is also used in computer science for simulations and in scientific/statistical experiments. Randomness

Getting a Random Number in Scratch pick random is under Operators. Getting a Random Number in Scratch

Let’s Look at a Program… This is the start of a program… What do you think it does? Let’s Look at a Program…

Finish the Program… Download dice.sb from the website. Finish the dice program so it works completely and then add a second die. You can duplicate the sprite but they need to work separately! See if you can figure out how to hide the variables from the screen. Finish the Program…