CS 101: Introduction to Computer Science
James Madison University, Fall 2019 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".

  3. Submit your completed worksheet via canvas.jmu.edu by 11:59 PM today. Do NOT change the name of the file; Canvas automatically appends your first and last name to the filename when I download the submissions for grading.

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.

Just to be clear, steps 4-7 are required too. You'll lose points if your profile picture is still a ghost.

More Fun

An older version of the game, Light-Bot 2.0, is available from Armor Games. It allows you to use additional types of instructions without buying the app, and it comes with a level editor.

If you finish early today, see how many of these levels you can solve. Or design your own and challenge your classmates!

Click here to play Light-Bot 2.0

(Source: http://armorgames.com/free-website-games)