Merge pull request #481 from Microsoft/booleans-updates
Booleans updates
This commit is contained in:
commit
662d881218
@ -1,9 +1,8 @@
|
|||||||
# Booleans
|
# Booleans
|
||||||
|
|
||||||
This lesson introduces the use of the boolean data type to control the flow of a program, keep track of state, and to include or exclude certain conditions.
|
![micro:bit Combo Box](/static/courses/csintro/booleans/cover.jpeg)
|
||||||
|
|
||||||
![Picture and quote of Shakespeare](/static/courses/csintro/booleans/shakespeare.png)
|
This lesson introduces the use of the boolean data type to control the flow of a program, keep track of state, and to include or exclude certain conditions.
|
||||||
Shakespeare knew Booleans (quote from Hamlet)
|
|
||||||
|
|
||||||
## Lesson objectives
|
## Lesson objectives
|
||||||
Students will...
|
Students will...
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# Activity: Double coin flipper
|
# Activity: Double coin flipper
|
||||||
|
|
||||||
|
![Example Board](/static/courses/csintro/booleans/fuzzies.jpg)
|
||||||
|
|
||||||
Guide the students to create a program using Boolean variables and operators.
|
Guide the students to create a program using Boolean variables and operators.
|
||||||
We’ll use our pseudocode from the previous activity to code a double coin flipper program.
|
We’ll use our pseudocode from the previous activity to code a double coin flipper program.
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# Project: Boolean
|
# Project: Boolean
|
||||||
|
|
||||||
|
![Two-Player Game Example Board](/static/courses/csintro/booleans/two-player.jpg)
|
||||||
|
|
||||||
This is an assignment for students to come up with a micro:bit program that uses Boolean variables, Boolean operators, and possibly the random function.
|
This is an assignment for students to come up with a micro:bit program that uses Boolean variables, Boolean operators, and possibly the random function.
|
||||||
|
|
||||||
## Input
|
## Input
|
||||||
@ -307,6 +309,13 @@ if (player1Turn == true && Math.random(4) < 3) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
## Reflection
|
||||||
|
|
||||||
|
Have students write a reflection of about 150–300 words, addressing the following points:
|
||||||
|
* How did you incorporate boolean variables into your micro:bit program?
|
||||||
|
* How did you incorporate boolean operators into your micro:bit program?
|
||||||
|
* Describe something in your project that you are proud of.
|
||||||
|
* If you had more time to work on this project, describe what you might add or change.
|
||||||
|
|
||||||
## Assessment
|
## Assessment
|
||||||
|
|
||||||
@ -315,28 +324,23 @@ if (player1Turn == true && Math.random(4) < 3) {
|
|||||||
### Boolean
|
### Boolean
|
||||||
|
|
||||||
**4 =** More than 2 Boolean variables are implemented in a meaningful way.<br/>
|
**4 =** More than 2 Boolean variables are implemented in a meaningful way.<br/>
|
||||||
**3 =** At least 2 Boolean variable is implemented in a meaningful way.<br/>
|
**3 =** At least 2 Boolean variables are implemented in a meaningful way.<br/>
|
||||||
**2 =** At least 1 Boolean variable is implemented in a meaningful way.<br/>
|
**2 =** At least 1 Boolean variable is implemented in a meaningful way.<br/>
|
||||||
**1 =** No Boolean variables are implemented.
|
**1 =** No Boolean variables are implemented.
|
||||||
|
|
||||||
### micro:bit program
|
### micro:bit program
|
||||||
|
|
||||||
**4 =** micro:bit program:<br/>
|
**4 =** micro:bit program:<br/>
|
||||||
`*` Uses Boolean variables in a way that is integral to the program.<br/>
|
`*` Uses Booleans in a way that is integral to the program.<br/>
|
||||||
`*` Uses a random function in a way that is integral to the program.<br/>
|
|
||||||
`*` Compiles and runs as intended<br/>
|
`*` Compiles and runs as intended<br/>
|
||||||
`*` Meaningful comments in code<br/>
|
`*` Meaningful comments in code<br/>
|
||||||
**3 =** micro:bit program lacks 1 of the required element.<br/>
|
**3 =** micro:bit program lacks 1 of the required element.<br/>
|
||||||
**2 =** micro:bit program lacks 2 of the required elements.<br/>
|
**2 =** micro:bit program lacks 2 of the required elements.<br/>
|
||||||
**1 =** micro:bit program lacks 3 or more of the required elements.
|
**1 =** micro:bit program lacks all of the required elements.
|
||||||
|
|
||||||
### Collaboration reflection
|
### Collaboration reflection
|
||||||
|
|
||||||
**4 =** Reflection piece includes:<br/>
|
**4 =** Reflection piece addresses all prompts.<br/>
|
||||||
`*` Brainstorming ideas<br/>
|
|
||||||
`*` Construction<br/>
|
|
||||||
`*` Programming<br/>
|
|
||||||
`*` Beta testing<br/>
|
|
||||||
**3 =** Reflection piece lacks 1 of the required elements.<br/>
|
**3 =** Reflection piece lacks 1 of the required elements.<br/>
|
||||||
**2 =** Reflection piece lacks 2 of the required elements.<br/>
|
**2 =** Reflection piece lacks 2 of the required elements.<br/>
|
||||||
**1 =** Reflection piece lacks 3 of the required elements.
|
**1 =** Reflection piece lacks 3 of the required elements.
|
||||||
|
@ -13,7 +13,7 @@ What’s a common issue with coin tosses? Students may bring up issues of trust
|
|||||||
|
|
||||||
Here’s a solution... The double coin toss.
|
Here’s a solution... The double coin toss.
|
||||||
|
|
||||||
![Two pennies showing heads and tails](/static/courses/csintro/booleans/two-coins.jpg)
|
![Two pennies showing heads and tails](/static/courses/csintro/booleans/pennies.png)
|
||||||
|
|
||||||
In a double coin toss, both people have a coin and they flip the coins at the same time.
|
In a double coin toss, both people have a coin and they flip the coins at the same time.
|
||||||
|
|
||||||
|
BIN
docs/static/courses/csintro/booleans/cover.jpeg
vendored
Normal file
BIN
docs/static/courses/csintro/booleans/cover.jpeg
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 79 KiB |
BIN
docs/static/courses/csintro/booleans/fuzzies.jpg
vendored
Normal file
BIN
docs/static/courses/csintro/booleans/fuzzies.jpg
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 115 KiB |
BIN
docs/static/courses/csintro/booleans/pennies.png
vendored
Normal file
BIN
docs/static/courses/csintro/booleans/pennies.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 182 KiB |
BIN
docs/static/courses/csintro/booleans/shakespeare.png
vendored
BIN
docs/static/courses/csintro/booleans/shakespeare.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 104 KiB |
BIN
docs/static/courses/csintro/booleans/two-coins.jpg
vendored
BIN
docs/static/courses/csintro/booleans/two-coins.jpg
vendored
Binary file not shown.
Before Width: | Height: | Size: 6.1 KiB |
BIN
docs/static/courses/csintro/booleans/two-player.jpg
vendored
Normal file
BIN
docs/static/courses/csintro/booleans/two-player.jpg
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 158 KiB |
Loading…
Reference in New Issue
Block a user