BYU logo Computer Science

To start this assignment, download this zip file.

Project 2 - Bit Problems

Inverting the World

Bit is in a world with a blue picture on a white background:

a large block Y

Invert the entire world. Blue should become empty, and empty should become blue. The final world should look like this:

all colors are inverted

There is a second world that looks like this:

a large block Y

and when Bit is done it should look like this:

a large block Y

You can find starter code in invert.py.

Blue S

Move Bit to the right edge of the grid. Along the way, if Bit encounters a green square, draw a blue ā€œSā€. The bends in the ā€œSā€ are marked by blocked squares.

The first world looks like this:

places to make two "s"s

and at the end should look like this:

two "s"s

The second world looks like this:

places to make four "s"s

four "s"s

You can find starter code in blue_s.py.

Escape

Bit is exploring a cave and finds a secret gem that has been hidden for centuries:

Bit is standing by a gem, with a cave passageway in front and water behind

Unfortunately, his enemies have started to flood the cave with water! Help Bit escape by (1) picking up the gem, (2) running through the cave, (3) climbing the moss-covered cliff at the end. The final world should look like this:

Bit is standing at the top of the cliff, with the gem behind them

The water has followed Bit as they run, and Bit has put down the gem to examine it.

There is a second world that looks like this:

Bit is standing by a gem, with a cave passageway in front and water behind

and the at the end should look like this:

Bit is standing at the top of the cliff, with the gem behind them

Note that the gem may be a ruby (red) or an emerald (green).

You can find starter code in escape.py.

Pools of Gems

When Bit was examining the gem, they discovered a secret ingredient that lets them replicate gems. So Bit goes to their backyard, where there are a bunch of empty holes. Bit picks up a gem, then fills the next pool with copies of that same gem.

One of the starting worlds looks like this:

Bit is at the start of a path, with gems and empty pools in front of them

at the end, the world should look like this:

Bit is at the end of a path, with pools all filled with gems

The other starting world looks like this:

Bit is at the start of a path, with gems and empty pools in front of them

at the end, the world should look like this:

Bit is at the end of a path, with pools all filled with gems

Grading

ActivityPoints
Inverting the World25 points
Blue S25 points
Escape25 points
Pools of Gems25 points