Roll out a bag of marbles onto the floor. Look at the random pattern made. If the bag of marbles was released would the same pattern be made? Ask students to explain.
Discuss random other events and randomisation with relevant examples.
Ask students, ‘Would you expect to see patterns with random events?’ Why or why not?
Introduce the ‘chaos game’ as a way to see how patterns can result from certain random events.
Use the pencil code program to run the ‘chaos game’, randomly moving the turtle to create a pattern (for more information, search 'chaos game’).
Have students analyze or fill in or change parts of the pencil code program. This program could be used to further your understanding of how you could use Pencil Code in the classroom, as a demonstration or discussion with your students, or as a way to introduce various CT concepts, such as pattern recognition or abstraction, to your students by inviting them to extend the existing functionality of the program.
|Abstraction||Identifying and extracting relevant information to define main idea(s)|
|Pattern Recognition||Observing patterns, trends, and regularities in data|
* Explore the Computational Thinking Concepts Guide for a list of the CT concepts, including tips for implementing each concept in your classroom.
Copy/Paste the following program into a ‘Blank Editor’ on the Pencil Code website.
# Copyright 2015 Google Inc. All Rights Reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. v = [ new Sprite('red dot').fd(200) new Sprite('blue dot').rt(120).fd(200) new Sprite('green dot').lt(120).fd(200) ] speed 1000 for [1..2000] p = random v turnto p fd distance(p) * 0.5 dot black, 2 await done defer()