BYU logo Computer Science

To start this assignment, download this zip file.

The following guide pages cover material needed for this assignment:

Homework 2c — Decomposition

1. Barcodes

For this problem, Bit wants to finish the barcodes. There are two starting worlds:

The bottom row has some blue squares

The bottom row has some blue squares

The finishing worlds should look like this:

The blue squares are turned to blue columns

The blue squares are turned to blue columns

The starter code is in barcodes.py.

2. Soccer fields

For this problem, Bit wants to plant grass in the soccer fields. There are two starting worlds:

Three rectangular soccer fields, marked by black squares, with an empty square leading to the next field

Four rectangular soccer fields, marked by black squares

Bit’s job is to put green inside each soccer field:

Soccer fields filled with green squares

Soccer fields filled with green squares

The starter code is in soccer_fields.py.

3. Bit-a-thon

Bit is participating in a triathlon! Help Bit climb down a mountain, swim across the river, and then cycle to the finish line. There are two race courses:

a mountain going down marked by black squares, then a river marked by blue squares, then a flat street marked by a row of black squares

a mountain going down, then a river, then a flat street

Bit should finish the course, tracing the running path in green and the cycling path in red:

a path following the mountain down painted green and a path painted red across the flat row

a path following the mountain down painted green and a path painted red across the flat row

The starter code is in bitathon.py.

Grading

ActivityPoints
barcodes.py4
soccer_fields.py8
bitathon.py8

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 decompose complicated problems well. Quality code uses functions to break a problem into pieces. Each function should have a descriptive name that indicates what it does. The quality code guide contains our standards for decomposition.

Not only will decomposition improve the quality of your code, it will make these problems much easier. Break the problem into the largest repeated sections first, like painting one soccer field. Then break that problem into its largest sections, like dropping down, painting one column, and climbing up.

RubricPoints
Whitespace1
Naming1
Decomposition4
Intent4
Total10