This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Once you know the Cartesian (x, y) coordinate of spiral position i in Part 1, | |
# you can compute Part 2 really easily using just a map from coordinates to int. | |
# map[(0,0)] = 1, and then you go around the spiral. At each new coordinate, you look | |
# at its nine neighbors with a pair of for loops. Most of them (including the new position) | |
# won't be in there. | |
# Here's a Python implementation to show what I mean. | |
# Essentially a Fibonacci-style dynamic | |
# programming calculation but with 2-3 neighbors. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
font-size: 12pt; | |
font-family: monospace; | |
font-weight: normal; | |
font-style: normal; | |
text-decoration: none; | |
color: black; | |
cursor: default; | |
} |