Flooding the Cavern

The purpose of this assignment was to write a program, using the Python programming language, which was capable of taking as input a file numerically describing the dimensions of a ‘cavern,’ filling each pocket of air (chamber) of the cavern with a different colored water, and producing as output a graphical representation of the cave with each chamber colored differently. The output would also produce a string of text documenting how many distinct chambers exist in the cave.

The IO looks like the following (python3  program_name   cave_desc_document):

$ python3 cavern.py cave.txt
3 chambers in cavern
Click mouse in cavern display to close

A link to the final code: cavern.py  cave.txt

Additional Files: graphics.py  grid.py

Additional cavern descriptions: cave2.txt  cave-tic-tac.txt  twisty-cave.txt

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s