Scratch Program Runner

advertisement
Computer Science 1172 Scratch
Project on Artificial Intelligence and
Computational Thinking
Nicholas Crabtree
Jiang Jiang Liu
Thinking Speaking Writing 1172
November 29, 2010
Scratch Program Runner
A Demonstration of Artificial
Intelligence and Computational
Thinking
Topics to discuss
• Scratch for new users
• Introduce the topic of Artificial Intelligence
• Demonstrate the different parts of the scratch
program so that students understand it
• Explain how the program shows AI in action
• Explain Computational thinking
Scratch Into
• What is Scratch?
• Scratch is a programming language that easy
to use for all.
• It uses simple drag and drop style
programming so that the user can easily see
and create their programs.
What is Artificial Intelligence
• Definition- AI or artificial intelligence is the
name given to a computerized mind that
consists entirely of programming code.
• In simpler terms it is something that can work
on its own without Human Intervention,
because it entirely runs off of code.
What is Computational Thinking
• Computational thinking is how we think
analytically. It builds upon the power and
limits of computing processes. It confronts the
riddle of what can Humans do better than
computers and what can computers do better
than humans.
• In laymens terms, it simply means our deep
thinking or technical thought.
Scratch Program “Runner”
• Following this slide is a simple scratch program called
“Runner” the object of this program is to show how AI
looks and operates and the use of Computational Thinking.
• The program takes a user controlled object, called a sprite,
in this case it is a car, and allows the user to maneuver it
into the black area where the user scores. However, there
are AI players that move back and forth in its path, so be
carefull. Because if one is touched you lose a life and you
only have 3. This program also utilizes Computational
Thinking; it allows a user to scan the game field and decide
how it would be best to score. While playing without losing
lives and in its coding it was well through out and shows
how computer players operate and how humans operate
against them.
Stage Script
Computational Thinking
The part that shows analytical thinking the
most is the Stage Script. When it asks for a
passcode it challenges the user to use his or
her brain by creating a simple riddle-like
question and it allows the user to think out
what they want to say to the computer
whether the answer is “yes” or “no”.
Stage Script Continued
Sword 1 Sprite
Sprite 2, and 3
• Please note sprites 2, and 3 are identical to 1 except that
they are set to different positions. Where sprite 1 is (X:-228
and y:-75) sprite 2 is (X: -224 and y:2), and sprite 3 (X:-208
and y:-31)
• Also note that these three sprites are the AI that moves
back and forth in the program. They simply run off code
that makes them slide back and forth at random speeds
and if they are touched the player loses a life. As one can
see, they are not being ran by a human, but off of code.
These Sprites also show Computational thinking. They show
a well thought-out code to program them to act a certain
way in the program. Although they can only think a
programmed way compared to the human player whom
can move in any direction.
Car Sprite
Computational Thinking in Car Sprite
This part of the program is perhaps the must
fundamentally sound it sets up the user
control of the sprite called “car”. And it allows
the user when playing the program to use
their mind to get passed the AI sprites. In the
program by allowing the player to go left,
right, down, and up. It also sets up a way for
the player to score whenever the player
touches the color black which is at the top of
the both backgrounds.
Game Over Sprite
Wall Sprite
Sword6 Sprite
Sword 7
• Please note Sword 7’s script is identical to Sword 6’s
except where its point of origin is Sword 7 (X: -214 and
Y:138) and sword 6 (X: -214 and Y:136)
• These are also AI set up by the programming code.
They are unique from sprites 1, 2 ,and 3 in that they
initially hide for 25 seconds and then they appear using
the look block piece in scratch “show.” This makes
them visible, and instead of using the glide feature
these sprites bounce around the background increasing
the difficulty. Again these are not controlled by the
user and are therefore considered AI.
Closing
• Thank you for your attention and have a great
day.
• Any Questions?
Download