0% found this document useful (0 votes)
344 views3 pages

9/27/2011 CS Implementing Animation Algorithms 1

This document provides instructions and guidance for students to write pseudocode to model the behavior described in a story problem. The story problem describes a snake attacking frogs on lily pads in a lake. Students are asked to identify objects and methods needed, and write pseudocode using loops and conditionals to model the frog jumping and snake attacking behavior indefinitely. Tips are provided to set up the world and objects before programming their actions, and to focus on basic movements rather than realistic graphics.

Uploaded by

Matt Carlberg
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
344 views3 pages

9/27/2011 CS Implementing Animation Algorithms 1

This document provides instructions and guidance for students to write pseudocode to model the behavior described in a story problem. The story problem describes a snake attacking frogs on lily pads in a lake. Students are asked to identify objects and methods needed, and write pseudocode using loops and conditionals to model the frog jumping and snake attacking behavior indefinitely. Tips are provided to set up the world and objects before programming their actions, and to focus on basic movements rather than realistic graphics.

Uploaded by

Matt Carlberg
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Do Now: 15 minutes For the following story: identify objects, methods you would create (including parameters they

need), and then write on paper an algorithm using pseudocode.


A snake is on land, looking towards three frogs on a lake with four lily pads (so one of the lily pads does not have a frog on it). The snake attacks the first frog, which just in the nick of time jumps to the free lily pad. The snake then attacks the second frog, which jumps in the nick of time to lily pad freed up by the first frog. The snake attacks the third frog, which jumps in the nick of time to the lily pad freed up by the second frog. The snake then attacks the first frog again. This process continues indefinitely.

Why do we use parameters? -Provide extra information for a method -So that we only have to code one method and it will work given any object/data provided as a parameter to the method.
Why do we use loops? -To do some action repeatedly Why do we use conditionals? -To give our code the power to do one of two things based on current data -To give our programs the power to decide

Set up the world and start programming it -we will continue working on this on Monday with the goal of adding realism
Tips: 1. Make a water world and use an island as the land 2. Use rocks instead of lily pads. 3. First, get the world set up with all objects in position before having them go into action. 4. Dont worry for now if the jumping and attacking dont look realjust get the basic movements downdont use move to

You might also like