CSC 115.005/006 Sonoma State University Spring 2022
Scribbler 2
CSC 115.005/006:
Programming I
Scribbler 2
Instructor: Henry M. Walker

Lecturer, Sonoma State University
Professor Emeritus of Computer Science and Mathematics, Grinnell College


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
  • Editing, Storing, and Retrieving Files in CS 115
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
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)
  • Intro. to eSpeak and Makefiles
  • eSpeakPackage.h
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: labNested LoopsExample
  • ft-inches-centi.c
Reading
  • Nested Loops
6: projectProject: Robot Actions— — —
7: 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
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: labProgram Correctness, and TestingExample
  • func-parm.c
  • func-parm-arrays.c
  • motors-test.c
  • object-avoid.c
  • follower-test.c
  • rand-beep.c
  • get-ir.c
Reading
  • 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
9: labFunction Pointers and ArraysExample
  • circle-circum-area-1.c
  • circle-circum-area-2.c
  • circle-circum-area-3.c
Reading
  • Function Pointers (Optional)
Function pointers and arrays of functions
module 011: Characters, Strings, and I/O
-5: projectProject: Robot Follows Typed Commands— — —
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
unit : Data Representation
-5: labUse of the gdb DebuggerReading
  • Debugging with GNU Debugger: a GDB Tutorial by Samuel Huang from the University of Maryland
Practice with the dgb Debugger
-4: labMachine-level ExplorationsReading
  • Machine-level Operations, Bit Manipulation, and Unions
bit-level operations
-4: labConsequences of Data RepresentationReading
  • Consequences of Data Representation on Programming
-4: labMachine-level Explorationsreading
  • King, Section 20.1, pages 509-515
  • Kernighan and Ritchie, Section 2.9, pages 48-49
bit-level operations
-3: labRepresentation of Floating-point NumbersReading
  • Binary Representation of Floating-point Numbers
IEEE floating-point representation
-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
-1: intro.Overview of Number RepresentationReading
  • Representation of Numbers: Unit Overview
module 100: Grouping Data and Image Processing with the Scribbler 2
-6: projectProject: Picture Suite— — —
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
Reading
  • Image Storage and Processing
storage of pixel data in a struct with a 2D array
5: labInsertion SortExample
  • insertion-sort-proc1.c
  • insertion-sort-proc2.c
  • insertion-sort-proc3.c
  • 2D-1D-array.c
  • insertion-sort-picture.c
Reading
  • Insertion Sort
module 101: Dynamic Memory, Pointers, and Linked Lists
-8: projectProject: Music Composition— — —
-7: ProjectProject: Robot Command Sequence— — —
-6: labProgram Management Header Files— — —division of programs into multiple files
-5: labLinked Lists for a Movie— — —movie application for lists
-4: labLinked-lists in C— — —basic list operations
-3: labScheme-like Lists in C— — —insertion and deletion at front of linked lists
-2: labMemory Allocation and Pointers— — —introduction to pointers and dynamic memory
-1: intro.Pointers and Dynamic Memory— — —
module 110: Bash Scripts
-6: intro.Abstract Data Types: Stacks and Queues— — —
-5: labStacks— — —array and linked-list implementations of stacks
-4: labBash Scripts— — —using bash scripts for testing
-4: projectProject: Comparing Stack Implementations— — —
-3: labQueues— — —array and linked-list implementations of queues
module 111: Imperative Problem Solving, Robots, and Varieties of Input and Output
-5: projectProject: Robot Parade— — —builds on earlier project for user control of robots
-2: labCommand-line Arguments— — —focuses upon arrays of strings and string processing
-1: intro.Overview of Command-line Arguments and Files— — —
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