Announcements: we will meet in the 3rd floor CS lab from now on. Assignment for 9/03: ------------------- (1) Watch the "Editor Introduction", "Move Blocks", and "Loops" tutorials at: http://www.ortop.org/NXT_Tutorial/html/essentials.html (2) Design a flowchart (or approximate NXT-G program) for the "Move" and "Loops" Exercises. If you do not understand the material, please try your best and bring specific questions to class. Recap ----- We've seen three kinds of programs: -Issuing instructions in realtime -Storing a list of instructions that will be executed without further input -Storing a flowchart that will be excuted without further input We tried to write directions to the CS lab for people coming to W304 late. We talked about the differences between a flat list of directions like those from last time vs a flowchart. It seems that the ability to make decisions adds a lot of power. We illstrated this by programming me to walk from the back of the room to the door without specifiying absolute measurements (i.e. we weren't allowed to use commands like "move 1 step," or "move 1 foot"). This gave us a generic program/flowchart that any one of us could have run to get to the door. We then shared our flowchart assignments. We note that there were lots of things to consider, and that part of the assignment was choosing the salient decisions to be made on the way to your first class. In general we want to reuse "code" we've already written. For example with a flowchart we could have: -Time for breakfast? -"No" branch goes to first class -"Yes" branch goes to DUC, but then has an arrow to the appropriate part of the "No" branch -- We saw some examples of comedic flowcharts on digg.com. We saw that a flowchart (or program) can be used to define a concept (e.g. dressing poorly), however such a mode of defintion seemed opaque. -- -We used a "loop" to design a way to repeat an action until an event happens -i.e. turn right until there is no obstacle within 1ft -we noted that we could use a dummy block that performs no action to design our loop: | start turning right | --> | dummy (i.e. carry on) | --> < obstacle within 1 ft? > -YES-> ... continue with next step -NO-> go back to above dummy statement This way we don't keep reissuing the "start turning right command," which might cause a jerk or delay. -we found that using the wall behind us might be a better point of reference than the front since it's closer -we found that the placement of the desks was critical to our success -designing a generic program to find its way without assuming a particular arrangement of the desks is more difficult -- Finally we tried to come up with a flowchart describing the behavior of the catch robot. We demoed the robot so we could try and understand its behavior first. -Instead of letting the robot sense my hand to stop, we obtained more consistent results by using a fixed surface, an eraser -It was difficult to tell by obersvation in which order the robot stopped, moved backwards, or opened its claws once it found an obstacle -We briefly saw the "real" NXT-G version of the program; although we may not have understood all the blocks, it did resemble our example flowchart