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

Outline for CSC 161 Modules

Introduction

The table below is a working draft of modules for CSC 161. Each module has these elements:

  1. an overall goal: at the end, students will have accomplished this goal
  2. a listing of topics from C, the Scribbler 2, or other areas
  3. a listing of readings (either from a textbook or from prepared materials) that provide the needed background for the topics
  4. 2-4 examples that illustrate the topics (full programs that together cover the listing of topics and could be used to introduce the material to CSC 161 students
  5. 2-4 lab exercises that engage students with the main elements needed to achieve the overall goal
  6. the description of one or more projects that will give students practice in the topics, encourage students to integrate the ideas, and conclude with students producing a project code that does something interesting in meeting the overall goal of the module

Resources

The table references these materials:

Table Outlining Current Modules

Module Overall Purpose Summary and Main Topics Readings Examples Lab Exercises Project Description
0 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. Each of these topics form major parts of the CSC161 curriculum.
This module introduces CSC161 students to the basics of Linux, C programming, and the Scribbler robots, including:
  • basic Linux
  • introduction to using the terminal
  • elements of a C program, including variables and primitive types
  • basic Scribbler actions (beeping)
  • reading about Linux
  • Kernighan & Ritchie: pp.1-13 (Introduction & 1.1-1.2, 2.1-2.3)
  • Scribbler 2 Notes:
    • S2 Robot Start-Up Guide: p.4-7
    • IPRE Reference Manual: p.3
    • generating sounds
    • myroLocal.h (?)
  • Notes on editing, compiling, and running C code with the Scribbler 2
  • Pirates of the Caribbean
  • Spirit Song needs to be connected with module
Program a song
Working in pairs, students should develop a program that includes a song/melody at least 30 seconds long. Students should also write a description of their program, compile the program, and run it. Songs which have been used by other groups (including the example programs) may not be used.
1 Motion (+song, motion)
This module introduces and explores the possibilities that are offered by loops and conditionals, which are fundamental aspects of computer science. The module also allows individuals to learn to program while paying attention to a program or robot that performs actions simultaneously, while reviewing how programs can change based on variables.
This module is to introduce CSC161 students to control flow in C and Scribbler programming, including
  • using conditional statements
  • using loops (e.g. initialization, iteration, condition testing, loop body, for, while)
  • Scribbler motion
  • Kernighan & Ritchie: Sections 1.3, 2.10-2.12, 3.2-3.6 (variables, conditionals, loops)
  • Scribbler 2 Notes:
    • basic motion
  • Dance
  • Ice cream truck, check against module content (April/Dilan)
  • conditionals: short programs on 1) find forward/backward setting, 2) find battery setting by counting beeps (based on if statements), 3) change action based on getObstacle, 4) hi-low game, review code: Erik/Dilan, use as base for lab
  • loops: 4 examples in 1 program: beep 0.5 second and pause (5 times); beep up octave; nested loop for seequence of beeps; infinite loop — spin in circle, program completed: April/David, need to build lab on program
  • Scribbler 2 motion (forward, turn, backward) (??? 1 day ???)
Make the robot dance and sing.
Working in pairs, students should develop a program that makes the robot move while beeping to a melody. The program should incorporate at least 3 loops, of which at least one must be a for loop, and one a while loop. The program must also include at least two if statements.
2 Motion and sensors
This module is expand the CSC161 students' working knowledge of C language, improve problem solving and creativity, and create an introduction to more complex programming than most CSC161 students have previously encountered.
The purpose of this module is to organize and study data and the logical complexity of programming in C, as well as advance knowledge of the scribbler robot, leading to learning:
  • one-dimensional arrays,
  • writing functions,
  • testing programs and functions,
  • values and addresses,
  • Scribbler 2 motion and sensors
  • Kernighan & Ritchie: Sections 1.6, 1.7, chapter 4, 5.1 (1-dimensional arrays, testing, functions, values and addresses, with the & operator)
  • Scribbler 2 Notes:
    • Scribbler 2 motion and sensors
    • myroLocal.h
  • Avoid object, program completed: Dilan/April, review within context of module
  • Move until a wall and turn right, program completed: Dilan/April, review within context of module
  • Follow moving object, program completed: April/Erik, review within context of module
  • Braitenberg machine: Alive
  • 1-dimensional arrays: looping through array of motions, program completed: Dilan/Erik, need to build lab based on program; 2-dimensional array approach also written
  • 1-dimensional arrays: playing song of notes, with notes in array, program completed: Dilan/Erik, need to build lab based on program
  • 1-dimensional arrays: take sequence of pictures and display them, program completed: Dilan/Erik, need to build lab based on program
  • testing:
  • functions: divide song into pieces and use functions for the parts — starting and ending versions, program completed: David/Dilan, perhaps use parameters as later lab
  • functions: robot hoedown, divide dance into pieces, and combine, program completed, David/Dilan, perhaps add parameters as later lab
  • values, addresses, and the & operator: write wrapper function that returns normalized values of sensors, program completed: Dilan/David, need to build lab based on program
  • Scribbler 2 sensors (avoid obstacle (??? 1 day ???)
Follow a moving object
Working in pairs, students should develop a program to follow a moving object in front of the robot; the robot should be able to turn to follow the object, and stop when the object is stationary.
3 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.
The purpose of this module is to move away from simple static program declaration towards writing programs that can take input and follow commands based on input, including:
  • characters
  • strings
  • input/output
  • Kernighan & Ritchie: Sections 1.5, 1.9, 5.2-6, 5.10, chapter 7 (characters, strings, I/O, pointers (part 1))
  • Scribbler 2 Notes:
    • myroLocal.h
    • see Scribbler web site
  • ???
  • characters (??? 1 day ???)
  • strings (??? 1 day ???)
  • I/O: basic menu framework, program completed: April/Erik, use as base for lab
Robot follows typed commands (2-3 days)
Working in pairs, students should design a program that controls the robot through commands typed into the terminal. Commands must include basic motion (forwards/backwards, turning, stopping), sound, and basic sensor use.
4 Image Processing
The purpose of this module is to introduce the customizable nature of self-written programs by using structs and 2-dimensional arrays. (???)
Dynamic data structures
The purpose of this module is to introduce CSC161 students to a wide variety of data structures, including
  • structs
  • 2-dimensional arrays
  • Kernighan and Ritchie: ???
  • Scribbler 2 Notes:
    • ???
  • program provides framework, students access struct to change pixel, shell complete: Erik/David, need to build into a lab
  • transform pictures, program completed for several transformations: Erik, need to build into a lab
  • structs: use struct to hold pixel data; transform pictures (??? 1 day ???)
Image processing (2 days)
Working in pairs, students should transform pictures --- details needed, highlighting problem solving
5 Music Composition
The purpose of this module is to introduce the customizable nature of self-written programs by using structs, but also to establish commonly-used data structures and their advantages and disadvantages. (???)
Dynamic data structures
The purpose of this module is to introduce CSC161 students to a wide variety of data structures, including
  • pointers
  • linked lists
  • Kernighan and Ritchie: Chapter 6 structs, pointers, linked lists
  • Scribbler 2 Notes:
    • ???
  • insert theme into canon/fugue
  • pointers: create/return array, populate with sensor data, shell and full program completed: David/Dilan, use as base for lab
  • linked lists (??? 2 days ???)
Music composition --- insertion of series of notes periodically into song tune (2-3 days)
Working in pairs, students should insert a series of notes periodically into the tune of a song; the program must implement at least one linked list, and contain one custom struct.
6
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
  • Kernighan & Ritchie: Chapter 2, Sections 7.5, 8.1 (structs, pointers, linked lists)
  • Reading about stacks and queues
  • Transform image in various ways integrate into module (Erik/[David])
  • stacks (??? 1-2 days ???)
  • queues (??? 2 days ???)
Do something interesting with pictures (2-3 days)
Working in pairs, students should write 5 image functions that take a picture using the Scribbler and modify it in some way. Students wishing inspiration may look at CSC151 functions for inspiration, or may devise their own "Photoshop-like" manipulations.
7 Integrated Robotics
The purpose of this module is to smoothly integrate and review 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
The purpose of this module is to wrap up the course, while introducing concepts used in later courses, such as
  • Files
  • Command-line arguments
  • Sorting
  • Queues
  • Kernighan & Ritchie: Sections 7.5, 8.1, 5.10 (files, command-line arguments, sorting, queues)
  • Scribbler 2 Notes:
  • use robot with command-line actions and with log file need to integrate with module (David/[Erik])
  • basics of files (??? 1 day ???)
  • elements of command-line arguments: controlling robot based on command line, program completed: April/Erik, use as base for lab
  • sorting (??? 2 days ???)
  • queues (??? 2 days ???)
Description of project needed
[Should integrate sensors, motion, song; loops, conditionals, i/o, functions; all should be tested]

This document is available on the World Wide Web as

http://www.cs.grinnell.edu/~walker/courses/161.fa11/module-outline.shtml

created created 29 June 2011
last revised 11 July 2011
Valid HTML 4.01! Valid CSS!
For more information, please contact Henry M. Walker at walker@cs.grinnell.edu.