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, bit starts in the bottom left

The bottom row has some blue squares, bit starts in the bottom left

The finishing worlds should look like this:

The blue squares are turned to blue columns, with bit ending in the bottom right

The blue squares are turned to blue columns, with bit ending in the bottom right

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. Bit starts in an empty square on the left

Four rectangular soccer fields, marked by black squares with an empty square leading to the next field. Bit starts in an empty square on the left.

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

Each field inside of the black rectangles have been painted green, the empty squares leading to the next field are still white. Bit ends in an empty square on the right

Each field inside of the black rectangles have been painted green, the empty squares leading to the next field are still white. Bit ends in an empty square on the right

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. Bit starts on the left, above the topmost black square.

the same type of world as above, with differently sized sections

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. Bit ends on the right

a path following the mountain down painted green and a path painted red across the flat row. Bit ends on the right

The starter code is in bitathon.py.