LMICSE: Lego Mindstorms in Computer Science Education

Site Map | Contact Us
Project Overview | Staff | Grant Information
Short Workshops | Primary Workshops
CS 1 | Data Str. & Algo. | Prog. Languages | Architecture | Intelligent Sys. | Operating Sys. | Net-centric
Ada | C | C++ | Java | Lisp

Laboratory Materials for CS 1

small logo

Overview

Labs included in this section are designed for a first course in object oriented programming. They procede through the usual CS 1 topic set with a relatively objects early approach. The language employed is Java, specifically LeJOS for the Mindstorms platform.

The Turtle

The turtle is the standard RCX robot that these labs employ. The instructions for its construction can be found on page 12 of the Robotics Invention System 2.0 Manual. The sensor configurations we utilize in some of the labs can be found on page 30 for the bump sensors, and page 34 for the light sensor.

The Turtle Labs

These labs cover the kinds of syntactic and semantic concepts that arise in a first programming class using Java. The labs are:

  1. Sequential Control: We use sequential code to have the "Turtle" robot to move in a few geometric figures. (Lab status: beta)
  2. Variables and Expressions: We introduce some further Turtle abilities and use variables to create more interesting shapes. (Lab status: beta)
  3. Methods: In this lab we introduce the use of parameter-less methods to separate code into parts and also the use of the Random class in Java. (Lab status: beta)
  4. Methods with Parameters / Scope: We dig deeper into the use of methods to abstract code into smaller, reusable units using parameters and return values, we introduce global variables, and we use the java.lang.Math class. (Lab status: beta)
  5. Classes: We define a class that allows musical notes and rests to be represented and played back by the RCX. (Lab status: beta)
  6. Event Driven Programming: We introduce the basics of event driven programming and then focus on using decision structures to respond to events. (Lab status: beta)
  7. Loop Control Structures: We work with each of the loop control structures that Java defines. (Lab status: beta)
  8. Using Interfaces: We define interfaces to run races and to draw figures with the robots. (Lab status: beta)
  9. Array Structures: We use arrays to record inputs from the user and then traverse a course, using the recorded values to know when to move and when to turn. (Lab status: beta)
  10. Navigation: We develop a class that represents a gridded area, stores the robot's location in the area and allows us to tell the robot to move to specific grid locations. (Lab status: beta)
  11. Inheritance: We define several classes that handle musical notes and rests, and an abstract class that each is an extension of. (Lab status: beta)
  12. Sorting and Polymorphism: We introduce polymorphism in the context of sorting algorithms. (Lab status: beta)

The dependencies between the labs are shown in the following diagram.

A relatively object-early approach to a CS 1 course could do the labs in numeric order, while an objects late approach could do labs 6 and 7 (control structures) before lab 5 (classes), and could even do lab 6 (if statements) before introducing parameter-less methods (lab 3).