To start this assignment, download this zip file.
Homework 1a β Introduction to Bit
Preparation
Download the zip file listed above, extract its contents, and put the files into
a folder called homework1a
, inside of your cs110
folder. Your folder
organization should look like this:
Notice that in this folder you have some Python files and then a directory
called worlds
. This directory contains worlds that Bit can operate in. When
you see a line like this in a Python file:
@Bit.worlds('fix-me')
this tells Bit to use the world called fix-me.start.txt
inside of the worlds
folder. It uses fix-me.finish.txt
to check whether you reached the correct
finishing world.
1. Fix me
You are given some code in fix_me.py
. Bit starts from a blank 5x3 world:
Bit should finish with a world that looks like this:
Run the code in fix-me.py
. It will finish with a comparison error. Fix the
error so the code runs correctly.
2. Fix me too!
You are given some code in fix_me_too.py
. Bit starts from a blank 5x3 world:
Bit should finish with a world that looks like this:
Run the code in fix-me-too.py
. It will show an error in the terminal. Fix the
error so the code runs correctly.
Note: there are multiple errors in this file
3. Make me smile
You are given some starter code in make-me-smile.py
. Bit starts from a 7x6
world with just some eyes:
Bit should finish with a world that has a completed smile:
Write code in make-me-smile.py
to complete the smile.
Note: you need the correct finishing position and direction for Bit as well!
4. Picasso
Now itβs your turn! Write a script called picasso.py
that draws whatever you
want.
Follow the pattern we used in Lab 1a, Exercise 1, which shows how to start from an empty world. Use a world of size 8x8.
You can call your function anything you want, but a good name is picasso
:-)
π§πΌβπ¨
Rules:
- you have to move/turn/paint at least 20 times
Grading
Turn your Python files in on Canvas, which will link you to Gradescope.
Activity | Points |
---|---|
fix_me.py | 5 |
fix_me_too.py | 5 |
make_me_smile.py | 5 |
picasso.py | 5 |
Manual grading will focus on basic style and fluency.