BYU logo Computer Science

To start this assignment, download this zip file.

The following guide pages cover material needed for this assignment:

Homework 2d — Variables

1. Color bars

For this problem, Bit wants to make bars of color. For this starting world:

The first row has some colored squares

the ending world should look like this:

The rows with colored squares are turned into a bar of that color

There is a second world:

The first row has some colored squares

that Bit should turn into this:

The rows with colored squares are turned into a bar of that color

The starter code is in color_bars.py.

2. Wells and vines

For this problem, Bit wants to grow vines and fill wells. Bit lives in this world:

a path with green squares (where vines go) and holes on the right (wells)

Bit’s job is to grow each fine and fill each well:

Soccer fields filled with grass

The starter code is in wells_and_vines_.py.

3. More lines

Bit starts in a world with some incomplete lines in each row:

incomplete lines in each row

Bit should fill all of the lines in each row:

all lines are complete in each row

There is a second world:

incomplete lines in each row

That Bit should turn into this:

all lines are complete in each row

The starter code is in more_lines.py.

Grading

ActivityPoints
color_bars.py4
wells_and_vines.py8
more_lines.py8

Note: Functions with more than one argument are not needed to complete wells and vines.

Manual Grading

Refer to the Quality Code guide page for detailed explanations and examples on each of these rubric criteria.

Intent

The intent of this assignment is for you to start to use variables, and that you write code that solves worlds of any size.

When a function has an additional argument (like color), it should use that argument somewhere within the function.

Note: A key indicator for a lack of decomposition is nested while loops. We recommend moving the inner loop to a new function.

RubricPoints
Whitespace1
Naming1
Decomposition4
Intent4
Total10