Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS320n –Visual Programming Problem Solving Case Study (Slides 6-3) Thanks to Wanda Dann, Steve Cooper, and Susan Rodger for slide ideas.

Similar presentations


Presentation on theme: "CS320n –Visual Programming Problem Solving Case Study (Slides 6-3) Thanks to Wanda Dann, Steve Cooper, and Susan Rodger for slide ideas."— Presentation transcript:

1 CS320n –Visual Programming Problem Solving Case Study (Slides 6-3) Thanks to Wanda Dann, Steve Cooper, and Susan Rodger for slide ideas.

2 Visual ProgrammingProblem Solving Case Study2 What We Will Do Today Look at a complicated problem Discuss different ways of solving it Learn some techniques in Alice Practice Writing methods and functions

3 Visual ProgrammingProblem Solving Case Study3 Problem to Solve Create a scene with 3 animals standing in a row resize each of them from 0.5 to 3 times its original size Find the animal that is tallest and spin it once to the right and once to the left Sort the animals by their height smallest on the camera’s left, tallest on the camera’s right Display message “In order” any time the animals are sorted

4 Visual ProgrammingProblem Solving Case Study4 Objects in the World Animals – Penguin, Joey, White Rabbit –careful to pick animals whose center point is at their feet –challenging if center point is higher –position animals 1 meter apart (use move to and move methods in set up) Need some way to track position –fixed objects (balls) 3D text “In Order!” in scene but invisible

5 Visual ProgrammingProblem Solving Case Study5 Initial Scene tennis ball is position 1, toy ball is position 2, volleyball is position 3 Use these as fixed points of reference

6 Visual ProgrammingProblem Solving Case Study6 Storyboard check if animals are sorted resize animals check if animals are sorted make tallest spin sort animals display in order (assuming sorted)

7 Visual ProgrammingProblem Solving Case Study7 world.my first method

8 Visual ProgrammingProblem Solving Case Study8 make Tallest Animal Spin Around find out which is tallest spin it around right, then spin it around left create a function to determine which of the three things is tallest

9 Visual ProgrammingProblem Solving Case Study9 tallest Of Three How do we do this? It’s not so bad for 3 but if there were more it would become too complicated

10 Visual ProgrammingProblem Solving Case Study10 check If Sorted By Height How do we check if items are sorted by increasing height? Check if object in position 1 is shorter than object in position 2 and if object in position 2 is shorter than object in position 3? How do we know which animal is in which position?

11 Visual ProgrammingProblem Solving Case Study11 which Object Is Closest To

12 Visual ProgrammingProblem Solving Case Study12 sort Animals By Height How? More than one way? Again, if we get more than 3 becomes very complicated, very quickly

13 Visual ProgrammingProblem Solving Case Study13 One Way determine which thing is in which position determine which thing is tallest if tallest is not in position 3, swap tallest with thing in position 3 then check if the thing in position 2 is taller than the thing in position 1 –if not then swap those 2 animals next to each other started out 1.5 meters apart –or could use distance to the left / right function

14 Visual ProgrammingProblem Solving Case Study14


Download ppt "CS320n –Visual Programming Problem Solving Case Study (Slides 6-3) Thanks to Wanda Dann, Steve Cooper, and Susan Rodger for slide ideas."

Similar presentations


Ads by Google