CSC 161 Grinnell College Fall, 2012
 
Imperative Problem Solving and Data Structures
 
 

Semester Outline for CSC 161

Module Dates Overall Purpose Summary and Main Topics Examples Lab Exercises Project Theme
0 (module details) Friday, August 31 — Tuesday, September 11 Introduction: Play a song
This module helps CSC161 students to gain familiarity with foundational concepts of C programming, the Scribbler robot, and the Linux terminal.
Basics of Linux and C
  • basic Linux
  • introduction to using the terminal
  • elements of a C program, including variables and primitive types
  • basic Scribbler actions (beeping)
  • Pirates of the Caribbean
  • Spirit Song
  • Linux commands
  • Elements of a C Program
  • Using the Scribbler 2: connect, disconnect, sound
Program a song
1 (module details) Wednesday, September 12 — Friday, September 21 Motion (+song, motion)
This module introduces and explores the possibilities that are offered by loops and conditionals. These capabilities are applied to controlling a robot that creates sounds and moves simultaneously.
Control structures
  • conditional statements
  • loops (e.g. initialization, iteration, condition testing, loop body, for, while)
  • Scribbler motion
  • Dance
  • Ice cream truck
  • Types and variables (with casting)
  • Conditionals, Scribbler motion
  • Loops
  • Loops and Scribbler 2 motion
Make the robot dance and sing
  Friday, September 28 Hour Test 1
2 (module details) Monday, September 24 — Wednesday, October 3 Motion and sensors
This module expands the CSC161 students' working knowledge of C language, improves problem solving and creativity, and creates an introduction to more complex programming.
functions and arrays
  • one-dimensional arrays,
  • writing functions,
  • testing programs and functions,
  • values and addresses,
  • Scribbler 2 motion and sensors
  • Avoid object
  • Move until a wall and turn right
  • Follow moving object
  • Braitenberg machine: Alive
  • 1-dimensional arrays
  • testing:
  • functions and parameters
  • values, addresses, and the & operator (2 labs)
Follow a moving object

(details)
Friday, October 5 — Tuesday, October 9 Data representation Representation of numbers
  • non-negative binary integers
  • sign-magnitude, ones- and twos- complement notation
  • floating point representations
  • integer representation
  • floating-point representation
  Wednesday, October 17 Hour Test 2
3 (module details) Wednesday, October 10 — Monday, October 29 Deepen understanding of imperative problem solving and C
The purpose of this module is to deepen understanding of the C language and smoothly integrate previous experience in the course into the larger framework of programming in C.
Arrays
  • characters
  • strings
  • input/output
  • forthcoming
  • characters and strings
  • Input/output
  • I/O: basic menu framework
Robot follows typed commands
4 (module details) Tuesday, October 30 — Wednesday, November 7 Image Processing
The purpose of this module is to introduce the customizable nature of self-written programs by using structs and 2-dimensional arrays.
Structured data
  • structs
  • 2-dimensional arrays
  • change pixel (shell, full program)
  • transform pictures
  • transform a pixel
  • transform pixels in a picture
  • sort pixels in a picture
Transform a Picture
5 (module details) Friday, November 9 — Tuesday, November 20 Music Composition
This module introduces dynamic data structures (with pointers and linked lists) as a means to store lines of music that evolve through the composition process.
Dynamic data storage
  • pointers
  • linked lists
  • program management (separate header, implementation, application files)
  • insert theme into canon/fugue
  • pointers: create/return array, populate with sensor data
  • linked lists (2 labs)
Music composition --- insertion of series of notes periodically into song tune
  Wednesday, November 21 Hour Test 3
6 (module details) Monday, November 26 — Monday, December 3 Storage/retrieval Patterns
This module increases familiarity with programming in C, integrates the Scribbler 2's sensors into the curriculum, and continues to practice previously-introduced concepts
The purpose of this module is to clarify previously introduced concepts, such as
  • more pointers and linked lists
  • queues
  • stacks
  • Bash scripts
  • Transform image in various ways
  • stacks
  • queues
  • Bash scripts (for testing)
Do something interesting with pictures or travel in a maze
7 (module details) Tuesday, December 4 — Friday, December 14 Integrated Robotics
This module integrates and reviews material that has been presented through the semester, with a particular emphasis on C programming concepts and full usage of the Scribbler robot.
Advanced Input/Output
  • Files
  • Command-line arguments
  • use robot with command-line actions and with log file
  • reading and writing with files
  • files for include, separate compilation, separate linking
  • command-line arguments
Robot motion with logging