

Rock-paper-scissors (microbit)
Presentation
•
Computers
•
9th Grade
•
Practice Problem
•
Hard
Andy tsui
Used 1K+ times
FREE Resource
11 Slides • 11 Questions
1
Rock-paper-scissors (microbit)

2
Objectives
Define and use variables
Variable data types
Storing input to variable
Conditional Statement
3
What is variable?
Store value in computer program
The value can be coming from input, results of calculations or just anything you want to store
4
Try defining variables in REPL mode
5
Fill in the Blanks
What is the value of variable A, after all the following code executed.
A = 10
Type answer...
6
Fill in the Blanks
What is the value of variable B, after all the following code executed.
A = 5
B = 10
C = 11
Type answer...
7
Fill in the Blanks
What is the value of variable B, after all the following code executed.
A = 5
B = 10
A = A + B
Type answer...
8
Fill in the Blanks
What is the value of variable A, after all the following code executed.
B = 10
C = 2 + 3
Type answer...
9
Variable types
Each variable, when defined, will be assigned a data type
There are a few data types in Python:
10
Types in python
int or integer
float, which stores numbers with decimals
string, for text, note when referring to string, we need to put a pair of double quote, e.g. "This is string", "10"
bool, stands for boolean
11
Boolean
Boolean is a special type that allows two possible values only: True and False
Boolean is for logical statement
12
Multiple Choice
What is the data type for the following variable A:
A = 15
int
float
string
boolean
13
Multiple Choice
What is the data type for the following variable A:
A = 1.5
int
float
string
boolean
14
Multiple Choice
What is the data type for the following variable A:
A = "15"
int
float
string
boolean
15
Multiple Choice
What is the data type for the following variable A:
A = True
int
float
string
boolean
16
Multiple Choice
What is the data type for the following variable A:
A = 3 > 4
int
float
string
boolean
17
Getting button press in Microbit
Try in REPL mode
18
Open Ended
Quick Review:
What is the command if we want to output a string "X" on the microbit LEDs?
19
Rock paper scissors device - 1
IF Button A is pressed, then display "R"
IF Button B is pressed, then display "P"
20
Open Ended
What is the logical statement, if we want to know if both button A and B is pressed?
21
Now complete the Program
also Add Press A+B will display "S"
22
Extended Activity
Try, instead of displaying text, display an image to represent Rock paper and scissors
Refer to the following document:
https://microbit-micropython.readthedocs.io/en/stable/tutorials/images.html
Rock-paper-scissors (microbit)

Show answer
Auto Play
Slide 1 / 22
SLIDE
Similar Resources on Wayground
17 questions
Horizontal and Vertical Lines LIVE
Presentation
•
9th Grade
17 questions
Nutrition - Food Groups
Presentation
•
9th Grade
17 questions
Using Point-Slope to Write Slope-Intercept Form
Presentation
•
9th Grade
17 questions
Electric Fields and Electric Charge
Presentation
•
9th Grade
20 questions
GOOGLE APPS
Presentation
•
9th Grade
16 questions
Troubleshooting
Presentation
•
9th Grade
20 questions
Basic Python Review Lesson
Presentation
•
9th Grade
17 questions
Speed and Velocity
Presentation
•
9th Grade
Popular Resources on Wayground
6 questions
PRIDE Always and Everywhere
Presentation
•
12th Grade
20 questions
Lab Safety Quiz
Quiz
•
6th Grade
26 questions
KOR Review Kahoot Questions
Quiz
•
8th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
12 questions
Unit Zero lesson 2 cafeteria
Presentation
•
9th - 12th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
10 questions
Riddles Riddles fun Riddles
Quiz
•
6th - 12th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade