Title: Programming with Alice Design (Storyboards) and Code
1Programming with Alice Design (Storyboards)
and Code
2Traditional Problem Solving in CS
- Read and understand the problem or task
specification - Design a solution (develop an algorithm)
- Implement (code)
- Test
- Revise, as needed
3Designing a Solution in Alice
- To create a design, we borrow the idea of
storyboards from professional animators at
Disney, Pixar, etc.
4Recall.A More Complex Scene
- Princess Escape
- A princess has been grounded by her father (a
wizard) and kept inside the castle. Being a
rather rebellious princess, she has sent email to
the local dragon taxi service. The dragon has
arrived and the princess will climb aboard the
dragon to escape from the castle.
5Visual Storyboards
6Textual Storyboard
Do in order dragon takes off dragon flies
to princess princess climbs on dragon's back
dragon and princess escape knight shakes his
arm (and sword) in protest
7Implementing a program in Alice
- Create the program instructions using the drag
and drop editor - We recommend an incremental approach
- write a method
- test it
- and so on.
8Stepwise refinement - 1
- How can a dragon "take off"?
Do together dragon moves up dragon flaps
wings
9Stepwise refinement - 2
- How can a dragon flap its wings?
Do together dragon flap left wing dragon
flap right wing
10Stepwise refinement - 3
- How can a dragon flap its left wing?
Do in order Do together dragon close left
wing rolls right dragon far left wing rolls
right Do together dragon close left wing rolls
left dragon far left wing rolls left
Is this too detailed? Probably, but you get the
picture
11Create a class-level method
12Drag the code into the editor
13The complete method
14Calling a method
15Your turn!
- Create the flapLeftWing method
- Create an analogous flapRightWing method
16Create a flapWings method
17Your turn!
- Create the flapWings method
- Create a takeOff method, where the dragon moves
up 2 meters and flaps its wings twice
18Create a fly method
19Saving out a new class
- Renaming the class
- Saving it
- Importing it for a different world
20Textbook
- More information
- Storyboards
- Chapter 2, Section 1
- Coding
- Chapter 2, Section 2
- Class-level Methods Inheritance
- Chapter 4, Section 3
-