Skip to content

Instantly share code, notes, and snippets.

@RyanBreaker
Created August 24, 2012 05:30
Show Gist options
  • Save RyanBreaker/3445869 to your computer and use it in GitHub Desktop.
Save RyanBreaker/3445869 to your computer and use it in GitHub Desktop.
towns = ['1', ['1.1', ['1.1.1', '1.1.2', '1.1.3'], '1.2', ['1.2.1', '1.2.2']],
'2', ['2.1', '2.2'], '3']
"""
1
|\
| 1.1
| | \
| | 1.1.1
| | |
| | 1.1.2
| | |
| | 1.1.3
| 1.2
| \
| 1.2.1
| |
| 1.2.2
2
|\
| 2.1
| |
| 2.2
3
"""
@Bluedagger21
Copy link

I love the map layout. It is powerful and flexible enough to handle any length name. Having loops such as 1.1.3 -> 1.2 will need a code change in placeZone(). This is possible, but will need some hard thinking and visualizing how the zones get placed. For example, how will placeZone() know when to create a path back to 1.2? Will it look at it's parents neighbors? That certainly could work, but the loops will be limited to just one level as shown here (1.1.3 could never connect to 2 for example).

@RyanBreaker
Copy link
Author

I've been thinking about it and I should be able to figure it out, but it might take a bit, depending on how long you'll wait before merging dev into master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment