CS 101: Introduction to Computer Science
James Madison University, Fall 2022 Semester

Lab01: Lightbot puzzle solving

Background

Lightbot is a puzzle game designed by Danny Yaroslavski while he was a CS major at the University of Waterloo. The goal of the game is to program a robot to walk around and light up all the blue tiles.

The latest version (see lightbot.com) has been redesigned for iOS and Android. It features a number of enhancements to the artwork and gameplay that make it more education oriented, easier to learn, and really fun to play.

Objectives

Key Terms

Procedure
An established way of doing something. In Lightbot, the series of commands for P1 / P2 are defined in Proc1 / Proc2.

Loop
A sequence of commands that are specified once but carried out multiple times. In Lightbot, loops are designed with recursion.

Recursion
The process of repeating items in a self-similar way. In Lightbot, a procedure may refer to itself to repeat commands indefinitely.

Instructions

Click here to play Lightbot HoC
(If the website is down, try the app instead: Android / iOS)
  1. Complete the Lightbot Code Hour, a free version consisting of 8 basic levels, 6 procedure levels, and 6 loop levels.

  2. Download Lab01-Worksheet.txt and open/edit the file using a text editor (e.g., gedit, Code, Notepad++). Make sure you save this file as plain text; if you use Word, you'll need to "Save as" and change the type to "Plain Text". When you save your file, remember to append your name to the existing file name, e.g., simmonsjLab01-Worksheet.txt or shorten to simmonsjLab01.txt

  3. Submit your completed worksheet via canvas.jmu.edu by Friday at 5pm.

As a final step for today's lab, take a few minutes and double check your Canvas account and notification preferences.

  1. In Canvas, click the "Account" icon on the upper left, then click "Settings".

  2. If you haven't done so already, please set up a profile picture of your choice.

  3. If you'd like to receive text messages from Canvas, click "+ Contact Method" on the right.

  4. Click "Notifications" on the left sidebar and verify what emails/texts you want to receive.