Download On-line activities – build “George Boole May I

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Logic programming wikipedia , lookup

Block cipher mode of operation wikipedia , lookup

Block sort wikipedia , lookup

Transcript
P R O J E CT G U T C
CL I M AT E C H AN G E U NI T
George Boole May I?
Review of Boolean logic and programming
Off-line activities – play “Human Boolean” game
Review the idea behind Boolean logic with students, and then play “Human
Boolean” game. Demonstrate each concept with the whole class, and have
students write a Boolean statement describing another student. If time allows,
discuss how these statements would be programmed in StarLogo, using a
conditional statement with a Boolean test (“If/then” or “If/then else” blocks).
On-line activities – build “George Boole May I?” program
This activity first reviews set-up procedures, randomness, set heading, and “Math
Basics” – allow students to work as independently as they are able.
In StarLogo, instruct students to set up a world with 30 turtles, make the turtles a
random size between 1 and 4, and put their pen down. In the set-up procedure,
have the turtles line up randomly on the left side of the screen, facing the right
side of the screen. In Spaceland, use “swap views” to show the model in 2-D.
Have students make a procedure in the turtle column that gives a single
instruction using an “if/then” block, and name the procedure “simple.” Get a
“run once” block from the setup and run drawer, place it in the runtime column,
and name it “simple”. Call the procedure (“My Blocks” drawers, “turtle” drawer)
in the renamed “run once” loop.
Make similar procedures using the “and” and “or” blocks (from logic drawer) to
combine a color (different than in the simple procedure) and a size. If you use
the same two for both the “and” and the “or”, it should make the logic clear to
PAGE 2
CLIMATE CHANGE UNIT
Make similar procedures using the “and” and “or” blocks (from logic drawer) to
combine a color and a size. If you use the same two for both the “and” block
and the “or” block, it should make the difference in the logic statements clear
to students. Use and rename “run once” blocks to call these procedures.
This activity also reviews creating, declaring, and setting a variable. Take an
“agent number” (blue) block from the variables drawer, place it in the turtles
column, and name it – age, hunger, energy, whatever the student wants. It
sometimes helps to write a comment on the block (right click on block) to
remind students not to throw away this variable. Once the variable is defined,
set it to a random number between 1-10 (in the set-up block).
CLIMATE CHANGE UNIT
PAGE 3
Once the variable is defined (named) and set to a random number, you can
use it as a new variation in the Boolean logic procedures. Have the students
create a “not” procedure and call it in a run-once block. Finally, create a
combination of “and”, “or”, and “not” statements in a single procedure (named
complex) and call that in a run once loop. The “say” block from the text drawer
will make the variable visible in SpaceLand as the turtles move.
Remember to have students save their model frequently, and stop to make
predictions about which turtle will win the race based on the variables they
have included in their Boolean statements.
If time allows, review looping in StarLogo by calling various procedures in a “Run
for” number of seconds block and a “forever” block – how does this change
which turtle wins the race?