### Lecture Notes

#### Lecture:: 01-16-2013 (Last post)

posted Jan 16, 2013, 7:19 AM by Samuel Konstantinovich   [ updated Jan 16, 2013, 8:17 AM ]

 Final Exam On Tuesday from 12:00 - 1:00Arrive EARLY for the exam. If you are late, you do not get extra time. (If there is a massive subway delay that is most unfortunate for you.)Room assignmentsPeriod 3: room 333Period 4: room 339Period 6: room 431Period 7: room 437Period 10: room 525Check your grades on the homework server. NOW, not after classes end. The last assignment titled "scheme" is blank for everyone, don't worry about that.

#### Lecture:: 01-14-2013

posted Jan 14, 2013, 6:01 AM by Samuel Konstantinovich   [ updated Jan 14, 2013, 6:01 AM ]

 A maz(ing) solverGoals: 1 Decide on what the start/end points of your path should be.2 Decide which patches you cannot travel on. e.g. walls or pits are certain colors.3 Set your starting point to a 'distance variable' of 0. We will use plabel for this to make it easier to see what is happening. All other plabels will default to "" (the empty string)4 You need to make a function to calculate the total distance from start to end, and every patch in between.   4a calculate by spreading: Every patch with a numerical distance variable should spread the distance to its neighbors (or neighbors 4) When you spread, you should increment the number so that each step is 1 unit farther.    4b You should make spread recursive, when should you not spread? The stopping condition matters!5 You want to trace the path from the end back to the start, by painting the patches a specific color. You can use another variable instead of pcolor (so you don't mess up the world) but we will use pcolor so we can see what is going on.    5a The "solve" command should ask the ending patch to trace a path   5b The trace command would then find the smallest neighboring distance and change that to blue, and call the trace command on that path.   5c When should you stop calling trace?By making the calculation and the tracing recursive, you can run this in the span of one go. This means you can re-calculate a path every go command if you want to.

#### Lecture:: 01-10-13

posted Jan 9, 2013, 1:58 PM by Samuel Konstantinovich   [ updated Jan 9, 2013, 1:58 PM ]

#### Lecture:: 01-08-2013

posted Jan 8, 2013, 6:24 AM by Samuel Konstantinovich   [ updated Jan 16, 2013, 8:20 AM ]

#### Lecture:: 01-07-2013

posted Jan 7, 2013, 6:17 AM by Samuel Konstantinovich   [ updated Jan 8, 2013, 10:31 AM ]

 Ack Monsters! Activity (for this activity, sliders will be denoted with the bold and underscores e.g. num_peopleYou will learn to make breeds behave in different ways depending on their state. Like with a corpse person vs a tired person.There are two breeds: monsters and towers.Setup:Create num_towers towers, and num_monsters monsters.The towers should be white, and "house" shaped. The monsters should be gray, and you can import a "monster" shape from the turtle shape editor. All turtles should be size 2 and placed randomly on the world. Every time the program runs go:Tower behavior: all towers rotate by rotate_speed degrees, and project a cone of light (yellow patches) This cone is tower_angle degrees wide, and tower_radius long.  Monster behavior:Monsters on a yellow patch turn "scared" Monsters on a black patch turn "angry"#UPDATE FOR IMPROVED AI HERE#You may want a variable to keep track of the state. Only monsters need this variable.*Optionally make the monsters have different shapes for angry and scared states.*Angry monsters: Fade* to color 2. Wiggle at a speed of .3 and random angle of 30. This makes the monster travel across the screen like a normal wiggle. Scared monsters:  Fade* to color 8.  Wiggle at a speed of .1 and random angle of 360. This makes the monster wiggle in place like they are scared. *:When I say fade that means the monster changes its color by 0.25 towards that color every time so that the color changes slowly.

#### Lecture:: 01-04-2013

posted Jan 4, 2013, 6:20 AM by Samuel Konstantinovich   [ updated Jan 4, 2013, 6:36 AM ]

 Note: Submit your scheme portion of the vacation homework on the homework server tonight. Zombies vs Humans II : revenge of the zombies (complete over the weekend if you don't finish in class) Swap code with your partners. You must implement several new features using their code as a starting point. New Features 5: Humans also need a shape for “tiredPerson” that is just a hunched over person. When their stamina is 5 or less, set their shape to “tiredPerson” otherwise set their shape back to “person”. This shows you when people are tired visually. 6. Zombies have a zombie_vision_angle (make it a slider from 1 to 360, default to 100) and should now use in-cone instead of in radius. Look up the in-cone command in the dictionary! 7: Humans now have a corpseTimer variable. Humans with a CorpseTimer of 0 behave normally(they do peoplestuff). Humans with a corpseTimer other than 0 do corpseStuff instead. Corpsestuff: change shape to “corpse” decrease corpseTimer by 1 when the timer reaches 0, make a zombie and die (or change into a zombie). 8. Zombies now have new features: When there is a human with a corpseTimer of 0 on the same patch as the zombie, the zombie will set ONE of those human's corpse_timer to 20. When there is a human with a corpseTimer other than 0 on the same patch the will run an eat command instead of chasing/shambling.The eat command just changes the zombie's label to “Brains!”. The zombies should reset their labels to “” (empty string) when they are not eating, so this clears away.

#### Lecture:: 01-03-2013

posted Jan 2, 2013, 10:33 AM by Samuel Konstantinovich   [ updated Jan 3, 2013, 6:19 AM ]

#### Lecture:: 01-02-2013

posted Jan 2, 2013, 5:28 AM by Samuel Konstantinovich   [ updated Jan 3, 2013, 5:31 AM ]

#### Lecture: 12-19-2012

posted Dec 19, 2012, 6:26 AM by Samuel Konstantinovich   [ updated Dec 21, 2012, 6:06 AM ]