Programming with Alice Design (Storyboards) and Code - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

Programming with Alice Design (Storyboards) and Code

Description:

Programming with Alice Design (Storyboards) and Code Traditional Problem Solving in CS Read and understand the problem or task specification Design a solution ... – PowerPoint PPT presentation

Number of Views:1085
Avg rating:3.0/5.0
Slides: 21
Provided by: Wand69
Category:

less

Transcript and Presenter's Notes

Title: Programming with Alice Design (Storyboards) and Code


1
Programming with Alice Design (Storyboards)
and Code

2
Traditional Problem Solving in CS
  • Read and understand the problem or task
    specification
  • Design a solution (develop an algorithm)
  • Implement (code)
  • Test
  • Revise, as needed

3
Designing a Solution in Alice
  • To create a design, we borrow the idea of
    storyboards from professional animators at
    Disney, Pixar, etc.

4
Recall.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.

5
Visual Storyboards
6
Textual 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
7
Implementing 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.

8
Stepwise refinement - 1
  • How can a dragon "take off"?

Do together dragon moves up dragon flaps
wings
9
Stepwise refinement - 2
  • How can a dragon flap its wings?

Do together dragon flap left wing dragon
flap right wing
10
Stepwise 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
11
Create a class-level method
12
Drag the code into the editor
13
The complete method
14
Calling a method
15
Your turn!
  • Create the flapLeftWing method
  • Create an analogous flapRightWing method

16
Create a flapWings method
17
Your turn!
  • Create the flapWings method
  • Create a takeOff method, where the dragon moves
    up 2 meters and flaps its wings twice

18
Create a fly method
19
Saving out a new class
  • Renaming the class
  • Saving it
  • Importing it for a different world

20
Textbook
  • More information
  • Storyboards
  • Chapter 2, Section 1
  • Coding
  • Chapter 2, Section 2
  • Class-level Methods Inheritance
  • Chapter 4, Section 3
Write a Comment
User Comments (0)
About PowerShow.com