CSC 161.01 Grinnell College Fall 2019
Scribbler 2
CSC 161.01:
Imperative Problem Solving with Lab
Scribbler 2
Course Home References Course Details: Syllabus, Schedule, Deadlines, Topic organization MyroC Documentation Project Scope/
Acknowledgments

Notes:

Organization of Course into Segments and Sessions

Course Segment Session ID Session Title Session Resources Session Notes
module 000: Getting Started with Linux, C, and the Scribbler 2
1: intro.Overview of CourseCourse Overview
  • Course Content Overview
  • Module Overview
Demo
  • scribbler-espeak.c
  • Single-robot motion, eSpeak, and beeping: single-robot-demo.c
  • avoid-obj.c
Reading
  • The Introductory Computer Science Sequence at Grinnell College
  • Pair Programming
  • Workstation Setup
Utility program
  • set-robot-name.c
Placing this course in context
2: labLinux/Mac OS X BasicsReading
  • Basic Linux Commands and Capabiities
  • Introduction to Emacs by Marge Coahran (Lab exercises optional for class preparation)
review of basic Linux commands and setting up .bashrc
3: labElementary C ProgrammingExample
  • quarts.c: A first program in C
  • temperature conversion, C version
  • temperature conversion with averaging
  • temperature conversion, Scheme version 1
  • temperature conversion, Scheme version 2
Reading
  • Getting Started with C Programming
basics of C syntax, editing, compiling, and running
4: labMore C with eSpeak and MakefilesExample
  • eSpeakExample1.c
  • eSpeakExample2.c
Reading
  • More Linux (Background processes, autocompletion, manual, printing)
  • Still More Linux (Files and File Permissions)
  • Intro. to eSpeak and Makefiles
  • eSpeakPackage.h
  • Sound on MathLAN Workstations
additional Linux commands, use of eSpeakPackage
5: labUsing the Scribbler 2 Robot and Mechanics of Basic InputDemo
  • beep-move-demo.c
Example
  • pirates.c
  • spirit-song-full.c
  • earsHangLow.c
  • spirit-song.c
  • quarts-rev.c
  • quarts-gallons.c
Reading
  • Programming with the Scribbler 2
  • Mechanics of Basic Input
  • MyroC documentation
program structure for MyroC
6: labIntroduction to Program OrganizationReading
  • Introduction to Program Organization
Introduction of include files; function to organize work; no parameters, no return; incremental software development
7: projectProject: Program a SongExample
  • scribbler-espeak.c
module 001: Conditionals, Loops, and Scribbler 2 Motion
1: intro.Overview of conditional statements and control structuresReading
  • Overview of conditionals, loops, and Scribbler 2 motion
2: labTypes, Variables, and CastingExample
  • quarts.c
  • printf-formatting.c
Reading
  • Types and Variables
3: labConditionals with the Scribbler 2Example
  • smallest3-1.c
  • smallest3-2.c
  • smallest3-3.c
  • smallest3-4.c
  • integer-words.c
  • light-switch.c
  • sensor-use.c
  • light-sensor-example.c
  • conditional-lightSensor-1.c
  • conditional-lightSensor-2.c
  • light-sensor-switch.c
  • blocking-nonblocking.c
Reading
  • Boolean Values and Expressions
  • An introduction to Conditional Statements in C
  • Scribbler 2 Sensors and Motion
  • Diagram of Scribbler 2 sensors and function calls
use of sensors in controlling the Scribbler 2
4: labLoops and Scribbler 2 MotionExample
  • ice-cream-truck.c
  • robot-dance.c
  • while-obstacle.c
  • do-while-beep.c
  • 3-loops.c
Reading
  • Reading on Loops
combining sensors, motion, and repeated actions
5: labSimple Simulations and More Program Management: Functions, Value Parameters, Assertions,Example
  • couple-1.c
  • couple-2.c
  • couple-3.c
  • couple-4.c
  • couple-5.c
  • couple-6.c
  • quadratic.c
  • coins.c
  • yoyo-program.c
Reading
  • Introduction to Simulation
  • Program Management with Functions and Assertions
introductory simulations and functions with and without value parameters and return values
6: projectProject: Robot Actions— — —
module 010: Functions, Addresses, Arrays,and Testing
1: intro.Function Prototypes and an Overview of Functions, Arrays, and AddressesReading
  • Arrays, Functions, Testing and Arrays: An Overview
2: labThe Run-time StackExample
  • pi-sim.c
  • value-param-example.c
  • add2.c
  • couple-6.c
  • lab-value-param.c
  • homework-value-param.c
Reading
  • The Run-time Stack
storage allocation within the run-time stack
3: labFunctions with Addresses as ParametersExample
  • func-sphere.c
  • perim-area-1.c
  • perim-area-2.c
  • perim-area-2a.c
  • func-exercise-1.c
  • func-exercise-2.c
  • quadratic-two-roots.c
  • func-exercise-3.c
Reading
  • Functions with Addresses as Parameters
experiments with values and addresses as parameters
4: labArraysExample
  • max-min.c
  • array-scale.c
  • array-move.c
  • photographer.c
  • max-array.c
Reading
  • Reading on Arrays
array storage, base addresses, indices
5: labFunction Pointers, Parameters, and Arrays, Program Correctness, and TestingExample
  • circle-circum-area-1.c
  • circle-circum-area-2.c
  • circle-circum-area-3.c
  • func-parm.c
  • func-parm-arrays.c
  • motors-test.c
  • object-avoid.c
  • follower-test.c
  • rand-beep.c
  • get-ir.c
Reading
  • Function Pointers (Optional)
  • Correctness and Testing
notes on pre- and post-conditions
6: intro.Overview of Characters, Strings, and I/OExample
  • counting-chars.c
  • char-example.c
Reading
  • Characters, Strings, and I/O: An Overview
7: labCharacters and StringsExample
  • character-example.c
  • io-NATO.c
  • string-example-1.c
  • string-example-2.c
  • string-intro.c
Reading
  • Characters in C
  • Strings in C
character coding, string storage and functions
8: projectProject: Uninterpretable DanceExample
  • darts.c (with random number generator)
project integrates all elements of C to this point
module 011: Characters, Strings, and I/O
3: labData input with scanfExample
  • scanf-example-1-2.c
  • scanf-example-3.c
  • scanf-example.c
  • scanf-char.c
  • i-o-example-1a.c
  • i-o-example-1b.c
  • i-o-example-2.c
  • i-o-example-3.c
  • i-o-example-4.c
Reading
  • Reading data with scanf
Use of scanf and format strings for reading
4: labCharacter-by-Character Input and OutputExample
  • option-prog-1.c
  • option-prog-2.c
  • scanf-s-test-1.c
  • scanf-s-test-2.c
  • get-3-char.c
  • getchar-example.c
  • input-examples.c
Reading
  • Character-by-character Input and Output
Use of getchar, putchar, printf
5: projectProject: Robot Follows Typed Commands— — —
unit : Data Representation
1: intro.Overview of Number RepresentationReading
  • Representation of Numbers: Unit Overview
2: labRepresentation of IntegersReading
  • Binary Representation of Integers
  • Representation of Signed Integers
Utility program
  • Program integer-sizes.c to display sizes of integer data types
  • Program integer-ranges.c to display ranges of integer data types
  • Program integer-rep.c to display binary representations of integers
  • Program integer-rep.ss (in Scheme) to represent binary representations of integers
3 representations of integers
3: labRepresentation of Floating-point NumbersReading
  • Binary Representation of Floating-point Numbers
IEEE floating-point representation
4: labConsequences of Data Representation and Use of the gdb DebuggerReading
  • Consequences of Data Representation on Programming
  • Debugging with GNU Debugger: a GDB Tutorial by Samuel Huang from the University of Maryland
5: labMachine-level ExplorationsReading
  • Machine-level Operations, Bit Manipulation, and Unions
reading
  • King, Section 20.1, pages 509-515
  • Kernighan and Ritchie, Section 2.9, pages 48-49
bit-level operations
module 100: Grouping Data and Image Processing with the Scribbler 2
1: intro.Overview of Grouping DataReading
  • Grouping data and image processing with the Scribbler 2: An Overview
2: labGrouping Data: StructsExample
  • square-move-1.c
  • square-move-2.c
  • square-move-3.c
  • square-move-4.c
  • square-move-5.c
  • square-move-6.c
  • test-scores-1.c
  • test-scores-2.c
  • test-scores-3.c
Reading
  • Reading on Structs
syntax, semantics, and applications of structs
3: labGrouping Data: 2-dimensional ArraysExample
  • city-precipitation.c
  • 2D-array.c
Reading
  • 2-dimensional arrays
4: labImage Storage and ProcessingExample
  • picture-splice.c
  • 2D-array-with-proc.c
storage of pixel data in a struct with a 2D array
5: labInsertion Sortreading
  • Program Management
6: projectProject: Picture Suite— — —
module 101: Dynamic Memory, Pointers, and Linked Lists
-8: projectProject: Music Composition— — —
-7: ProjectProject: Robot Command Sequence— — —
1: intro.Pointers and Dynamic Memory— — —
2: labMemory Allocation and Pointers— — —introduction to pointers and dynamic memory
3: labScheme-like Lists in C— — —insertion and deletion at front of linked lists
4: labLinked-lists in C— — —basic list operations
5: labLinked Lists for a Movie— — —movie application for lists
6: labProgram Management Header Filesreading
  • Program Management
division of programs into multiple files
module 110: Stacks and Queues
1: intro.Abstract Data Types: Stacks and Queues— — —
2: labStacks— — —array and linked-list implementations of stacks
3: projectProject: Comparing Stack Implementations— — —
4: labBash ScriptsReading
  • Bash Scripts
using bash scripts for testing
5: labQueues— — —array and linked-list implementations of queues
6: projectProject: Comparing Stack Implementationsproject
  • Stack Storage Results
module 111: Imperative Problem Solving, Robots, and Varieties of Input and Output
1: intro.Overview of Command-line Arguments and Files— — —
2: labCommand-line Arguments— — —focuses upon arrays of strings and string processing
3: labFile Input and Output with Characters and Strings— — —basic input of characters and strings
4: labFile Processing Applications (Optional)— — —practice using stream input from text files
5: projectProject: Robot Parade— — —builds on earlier project for user control of robots