Computer Science 101: Lab #2
This lab will build on the Calico / Python / Myro skills we acquired last week.
To get started, turn on your Scribbler, launch Calico, and connect to the
Fluke board in the usual way:
from Myro import *
where XXXX is the four-digit hexadecimal code on your Fluke.
Now start reading Chapter 2 of the
textbook (you can skip the intro and go right to the section
The Scribbler: Robot Movements). Follow the instructions provided
by the author, making sure to complete the programs specified in the
Do this sections. Let me emphasize again that you should be doing very
little typing – copy code from the text and paste it into Calico
whenever possible, making sure not to copy the python> prompt
itself. When it comes time to save your Python scripts, don't worry about
saving them where the author tells you; instead, save them in your Documents
folder, so you can retrieve them later.
Once you have saved and re-loaded your moves.py file, continue reading
and doing Exercises 1 - 6. As you do the exercises, add functions to
moves.py, while also writing answers to the questions in your writeup
file. If you have time, try some of the challenges in
Exercises 7 - 9. When you're done, submit (by email) a single
moves.py file for your team, as well as the PDF for your individual
writeup (e.g. levys_lab2.pdf). One team member can submit moves.py for the
whole team, but be sure to put your team members names and other important info in a comment
at the top:
# File: moves.py
# Purpose: Useful robot commands to try out as a module.
# CSCI 101 Lab 1
# 17 JAN 2013
# Team Banzai: Napoleon Dynamite, Simon Levy, John McAflee
Here are some tips to avoid frustration:
- Always have from Myro import *
as the first line of your python scripts.
- As soon as as you make a modification to a script, save the script by clicking on the
little blue floppy-disk icon, then run the script by clicking on the
circular green button (green for go). Then you can run the functions in the script by switching
tabs to the Shell and invoking the function you want – e.g.,
You can also make
your script invoke the functions for you by putting the function invocations
at the end of the script.