CS 115 Module to Introduce Conditionals, Loops, and Scribbler 2 Motion
Project Options
Working in pairs, students should develop a program that includes these elements:
- Program controls robot such that the robot avoids obstacles in the room.
-
If robot performs the same two turns in a row (e.g. two right turns), robot
beeps and turns for a second or two (before performing any further movements).
Notes:- The beep/turn around activity applies only when there are two turns, so going forward or backward twice in a row does not count!
- To accomplish this requirement, you likely will need at least one variable that keeps track of the previous robot activity. This variable is updated after each action. After a turn left or right, this variable can be consulted to determine if the previous move was the same type of turn.
- Every ten actions, robot performs a short dance three times in a row (the dance can just be a few actions).
-
Program contains at least two
if
statements -
Program contains at least three loops, at least one of which must be
a
for
loop, and at least one must be awhile
loop. - Program uses eSpeak to announce each time it turns, each time it moves forward or backward, and each time it performs its short dance after ten other actions.
Together with the program, a student pair must write a paragraph that describes what steps are needed to demonstrate the program is working correctly. That is, once the program is written, what do you need to do in order to check it is performing properly. (This might include describing some runs, in which obstacles are placed in the path of the robot.)
Grading
Project Submission
As with Project 000, submission of your project should include two printed elements:
- a program listing
-
a description and results of the testing you performed to check the correctness of your program
(Since this program uses the Scribbler 2 robot, it is not feasible to turn in the output of the program (that would require a recording of the music played)! Instead, prepare a written statement that describes the result of testing — what happened when you ran your program, and why was that a correct result that meets the specifications of the project?)
Some additional guidelines follow:
- The very first part of a program listing should indicate the authors of the project (use a C comment).
-
The paragraph description for testing should be placed in a separate
document, outside the program.
- Please be sure the author's names are at the top of the page.
- The testing description should not trace what the code does, but rather describe how the program has been tested. (Tracing the code simply repeats the program, so an error in logic in the code would naturally just be restated in tracing the code.)
created 24 June 2011 by Henry Walker full revision 20 July 2011 by April O'Neill minor editing 14 September 2011 by Henry M. Walker revision 16 February 2012 by Henry M. Walker revised 20 July 2012 by Henry M. Walker dates updated 1 September 2012, 31 December 2012, 11 February 2013, 13 August 2014, 15 September 2014, 14 January 2015 by Henry M. Walker reformatted 17 July 2016 by Henry M.Walker |
![]() ![]() |
For more information, please contact Henry M. Walker at walker@cs.grinnell.edu. |