Skip to content

Instantly share code, notes, and snippets.

@cnocon
Created September 7, 2013 17:08
Show Gist options
  • Save cnocon/6477320 to your computer and use it in GitHub Desktop.
Save cnocon/6477320 to your computer and use it in GitHub Desktop.
Land Mass Array from Chris Pine's "Learning to Program" page 74
# These are just to make the map easier for me to read. # "M" is visually more dense than "o".
M = 'land'
o = 'water'
world = [[o,o,o,o,o,o,o,o,o,o,o],
[o,o,o,o,M,M,o,o,o,o,o],
[o,o,o,o,o,o,o,o,M,M,o],
[o,o,o,M,o,o,o,o,o,M,o],
[o,o,o,M,o,M,M,o,o,o,o],
[o,o,o,o,M,M,M,M,o,o,o],
[o,o,o,M,M,M,M,M,M,M,o],
[o,o,o,M,M,o,M,M,M,o,o],
[o,o,o,o,o,o,M,M,o,o,o],
[o,M,o,o,o,M,o,o,o,o,o],
[o,o,o,o,o,o,o,o,o,o,o]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment