Flowchart Example Flowchart For Animated Story

4m ago
8 Views
0 Downloads
1.21 MB
7 Pages
Last View : 28d ago
Last Download : n/a
Upload by : Ronan Garica
Transcription

9/18/12 Help Organize Program: Flowcharts UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 202: Introduction to Computation Professor Andrea Arpaci-Dusseau Flowchart: " How can computation create animated stories? Visual representation of steps of algorithm Summarizes how algorithm behaves given specific answers Symbols Boxes: Represent states (or actions or actions) Arrows (or edges): Show transitions (or decisions) between states Flowchart Example Flowchart for Animated Story Animated Story: Behaves the same every time No decisions! Flowchart is summary of action of story How to create flowchart? Identify Initial State or Scene Group individual actions into higher-level “scenes” – Somewhat subjective (no right answer) – Label with descriptive name Identify characters of story – Specify actions of each character in scene Connect scenes sequentially 1

9/18/12 Animated Story Flowchart of Animated Story *Initial state* See Scratch code posted on web site! Flowchart of Animated Story *Initial state* Background: Railroad Cat: Left side Dog: Right side Flowchart of Animated Story *Initial state* Background: Railroad Cat: Left side Dog: Right side *Introductions* Cat: What should we do? Dog says: I don't know 2

9/18/12 Flowchart of Animated Story *Initial state* Background: Railroad Cat: Left side Dog: Right side *Introductions* Cat: What should we do? Dog says: I don't know *Color* Cat says: Lets do Tricks! Cat: I can change colors! Cat changes to 5 colors Cat changes back Flowchart of Animated Story *Initial state* Background: Railroad Cat: Left side Dog: Right side *Introductions* Cat: What should we do? Dog says: I don't know *Color* Cat says: Lets do Tricks! Cat: I can change colors! Cat changes to 5 colors Cat changes back *Whirl* Cat says I can whirl Cat whirls 5 times Cat changes back Flowchart of Animated Story *Initial state* Background: Railroad Cat: Left side Dog: Right side *Whirl* Cat says I can whirl Cat whirls 5 times Cat changes back *Introductions* Cat: What should we do? Dog says: I don't know *Fly* Cat moves 5 times Cat goes back *Color* Cat says: Lets do Tricks! Cat: I can change colors! Cat changes to 5 colors Cat changes back Flowchart of Animated Story *Initial state* Background: Railroad Cat: Left side Dog: Right side *Whirl* Cat says I can whirl Cat whirls 5 times Cat changes back *Introductions* Cat: What should we do? Dog says: I don't know *Fly* Cat moves 5 times Cat goes back *Color* Cat says: Lets do Tricks! Cat: I can change colors! Cat changes to 5 colors Cat changes back *Tiny* Cat becomes tiny Dog says I like that! Cat says why? 3

9/18/12 Flowchart of Animated Story *Initial state* Background: Railroad Cat: Left side Dog: Right side *Whirl* Cat says I can whirl Cat whirls 5 times Cat changes back *Introductions* Cat: What should we do? Dog says: I don't know *Fly* Cat moves 5 times Cat goes back *Color* Cat says: Lets do Tricks! Cat: I can change colors! Cat changes to 5 colors Cat changes back *Tiny* Cat becomes tiny Dog says I like that! Cat says why? *Eat* Dog says: No reason Dog walks until reaches cat Cat meows and disappears Dog says yummy How to Transform Flowchart to Scripts? Flowchart of Animated Story *Initial state* Background: Railroad Cat: Left side Dog: Right side *Whirl* Cat says I can whirl Cat whirls 5 times Cat changes back *Eat* Dog says: No reason Dog walks until reaches cat Cat meows and disappears Dog says yummy *Introductions* Cat: What should we do? Dog says: I don't know *Color* Cat says: Lets do Tricks! Cat: I can change colors! Cat changes to 5 colors Cat changes back *Tiny* *Fly* Cat moves 5 times Cat goes back Cat becomes tiny Dog says I like that! Cat says why? *Fadeout * Background and Dog fade out Background shows The End How to Tell Another Script to Run? Approach For each scene in flowchart, specify a script – Blocks in script show individual actions to be performed – Specify script for each character that does something How to determine when script can run? When should “Initial state” run? – When GreenFlag is Clicked When should dog say “I don’t know” in “Intro”? – After cat says “What should we do today?” How will dog know cat has finished saying that? Need to coordinate actions ACROSS cat and dog! 4

9/18/12 How to Run Desired Script? Wait for Scripts to Complete! Beauty of Abstraction Treachery of Images Abstraction: Separation of high-level view of entity from low-level details of implementation When sender broadcasts “jump”, doesn’t know how “jump” is implemented by different Sprites Why is this good? Simplifies concerns of sender (don’t need to know everything) Can change implementation of “jump” Of course, receiver might not implement “jump”! 5

9/18/12 Naming Convention for Messages Show Code Now Use good descriptive names Purpose of names help others understand your code Suggestion: Name matches name of scene – Intro, Color, Whirl, Fly, Tiny, Eat, Fadeout Problem: Hard to follow flow of messages across Sprites Solution: 1." Use Stage to control action as much as possible 2. Use naming convention to help understanding – SceneName : Receiver – e.g., ”Eat : Dog” Programming Concepts General Divide high-level functionality into logical units Descriptive naming is important Initial state must be specified Incrementally test code as you go Scripts must be activated to run Execution within script proceeds sequentially Control : forever, repeat times , repeat until Parameters (to blocks) specify behavior Goal is to make “non-fragile” code Check-Up In your animated story all the scripts are running at the same time. What did you do wrong? Can a Sprite receive a message it broadcast? When will this code work correctly? when not? – When flag clicked; When receive message 6

9/18/12 Homework 2: Extra Credit http://scratch.mit.edu/galleries/view/176626 7

Flowchart of Animated Story *Initial state* Background: Railroad Cat: What should we do? Cat: Left side Dog: Right side *Introductions* *Color* Cat says: Lets do Tricks! Cat: I can change colors! Cat changes to 5 colors Cat changes back *Whirl* Cat says I can whirl Cat whirls 5 times Cat changes back Flowchart of Animated Story *Initial state*

Related Documents:

Flowchart Example Flowchart for Animated Story Animated Story: Behaves the same every time No decisions! Flowchart is summary of sequential action of story How to create flowchart? Identify Initial State or Scene Group individual actions into higher-level "scenes" - Somewhat subjective (no right answer)

Bruksanvisning för bilstereo . Bruksanvisning for bilstereo . Instrukcja obsługi samochodowego odtwarzacza stereo . Operating Instructions for Car Stereo . 610-104 . SV . Bruksanvisning i original

Flowchart di bedakan menjadi 5 jenis flowchart, antara lain system flowchart, document flowchart, schematic flowchart, program flowchart, . menggunakan symbol-simbol bagan alir sistem, juga menggunakan gambar-gambar computer dan peralatan lainnya yang digunakan. Maksud penggunaa gambar-gambar ini adalah untuk memudahkan .

To search for animated graphics, use Google images, but look for ones that move or are animated. (These will usually be .gif files.) (There is a link on our website online for additional graphics. You will need to right click and save the picture to your picture folder.) Animated Sea Graphics Insert the Animated Graphics:

10 tips och tricks för att lyckas med ert sap-projekt 20 SAPSANYTT 2/2015 De flesta projektledare känner säkert till Cobb’s paradox. Martin Cobb verkade som CIO för sekretariatet för Treasury Board of Canada 1995 då han ställde frågan

service i Norge och Finland drivs inom ramen för ett enskilt företag (NRK. 1 och Yleisradio), fin ns det i Sverige tre: Ett för tv (Sveriges Television , SVT ), ett för radio (Sveriges Radio , SR ) och ett för utbildnings program (Sveriges Utbildningsradio, UR, vilket till följd av sin begränsade storlek inte återfinns bland de 25 största

Hotell För hotell anges de tre klasserna A/B, C och D. Det betyder att den "normala" standarden C är acceptabel men att motiven för en högre standard är starka. Ljudklass C motsvarar de tidigare normkraven för hotell, ljudklass A/B motsvarar kraven för moderna hotell med hög standard och ljudklass D kan användas vid

Fiction Excerpt 1: The Adventures of Tom Sawyer (retold with excerpts from the novel by Mark Twain) Saturday morning was come, and all the summer world was bright and fresh, and brimming with life. There was a song in every heart; and if the heart was young the music issued at the lips. There was cheer in every face and a spring in every step. The locust trees were in bloom and the fragrance .