Getting Computer Science into the K-12 Curriculum CodeCrush Computational Thinking is… A problem solving approach… … solving a problem by explaining the steps needed to arrive at t
Trang 1Getting Computer Science into the K-12 Curriculum
Programming with Scratch
Harvey Siy
hsiy@unomaha.edu http://www.cs.unomaha.edu/~hsiy
Trang 3Getting Computer Science into the K-12 Curriculum
CodeCrush
Computational Thinking is…
A problem solving approach…
… solving a problem by
explaining the steps
needed to arrive at the solution
To explain the steps, you have to:
• come up with the steps
• communicate them
• defend them
3 2/26/2014
Trang 4Explaining the steps
• come up with the steps
– involves creativity – involves recognizing similar situations
• communicate the steps
– how can I express them clearly?
– involves creating an algorithm*
– forms the basis of computer programming
• defend the steps
– are these the right steps?
– will these lead to a correct solution?
– involves logical reasoning and critical thinking
* step-by-step procedure for solving a problem
Trang 5Getting Computer Science into the K-12 Curriculum
• Coding is the most fun way to practice computational thinking
• Lots of resources for all grade levels from Hour of Code:
Teaching Computational Thinking
5 2/26/2014
Trang 7Getting Computer Science into the K-12 Curriculum
Development Environment
7 2/26/2014
Trang 8Development Environment
Trang 9Getting Computer Science into the K-12 Curriculum
Development Environment
9 2/26/2014
Trang 10Development Environment
Trang 11Getting Computer Science into the K-12 Curriculum
Sprite
11 2/26/2014
Sprite
- An object that performs some action
- Can define “indefinite” number of sprites in a program
Stage
- A special sprite
- 480x360
- Always in the background
The stage and sprites can have scripts
Trang 12Arithmetic, string, Boolean operators
Variables and lists
Event handling
Advanced blocks
Trang 13Getting Computer Science into the K-12 Curriculum
Observations (subject to change)
• Real numbers are 64-bit floating point
• Integers appear to be unbounded
• Lists can only have numbers, strings,
Booleans
– No list of lists
– No list of sprites
• Recursion is not allowed
– Except tail recursion
13 2/26/2014
Trang 14Flow of execution
• Sequence – one instruction followed by the
next
• Decisions – compute a condition
– if true, follow one set of instructions
– if false, follow an alternative set of instructions
• Loops – allows a set of instructions to be
executed repeatedly
• Events – determines when to start an
Trang 15Getting Computer Science into the K-12 Curriculum
Example 1:
Computing square roots
• Use algorithm by Hero of Alexandria
To compute square root of x
1 Start with arbitrary positive value s
2 Replace s by (s + x/s)/2
3 Repeat #2 until s has stopped changing
15 2/26/2014
Trang 16Solution
To compute square root of x
1 Start with arbitrary positive value s
2 Replace s by (s + x/s)/2
3 Repeat #2 until s has stopped
changing
Need to make variables Access the working version at:
Trang 17Getting Computer Science into the K-12 Curriculum
Trang 18Example 2: Pong
Move ball
When paddle hits ball
When paddle misses
Access the working version at:
Trang 19Getting Computer Science into the K-12 Curriculum
Example 3: Sorting
• Download the Scratch programs from
• Find the selection sort program
• Gives example of:
– Multiple sprites
– Event handling
– Lists
19 2/26/2014
Trang 20Physical interactions
• Scratch offers additional forms of
interaction beyond the traditional keyboard and mouse
Trang 21Getting Computer Science into the K-12 Curriculum
Example 4: Webcam
interaction
21 2/26/2014
Detect motion
by webcam
Remember to turn off webcam when done!
“Faster” motion detected: move sprite up
“Slower” motion detected: move sprite down
Access the working version at:
http://scratch.mit.edu/projects/10673482/
Trang 22Makey Makey
See demo at: http://vimeo.com/60307041
Trang 23Getting Computer Science into the K-12 Curriculum
Makey Makeys
in action
23 2/26/2014
Trang 24Picoboard
Slider
Clips
Light sensor
Sound sensor
Button
Trang 25Getting Computer Science into the K-12 Curriculum
Picoboard controls
(1.4)
25 2/26/2014
Sensing button
sensor value sensor condition test
Trang 26Comparable languages
Trang 27Getting Computer Science into the K-12 Curriculum
Alice
27 2/26/2014
Trang 29Getting Computer Science into the K-12 Curriculum
Greenfoot
29 2/26/2014
A gentle transition into Java
Trang 30CS Unplugged
• http://csunplugged.org
• Computational thinking without computers!
Trang 31
Getting Computer Science into the K-12 Curriculum
Computational Thinking across the curriculum
31 2/26/2014
Information technology
Modeling, Simulation Computer-aided design
Automated theorem proving, Numerical analysis
Trang 32Computational Thinking courses
Exploring Computer Science
http://www.exploringcs.org/
Computer Science Principles
http://www.csprinciples.org/
Trang 33Getting Computer Science into the K-12 Curriculum
Some CS Resources
• J Wing Computational Thinking, Communications of the ACM,
March 2006
• Computer Science Teachers Association, http://csta.acm.org
• Google Exploring Computational Thinking,
Trang 34• After-school lessons:
http://scratch.redware.com/lessonplan