Skip to content

lenarother/santa-helpers

Repository files navigation

santa-helpers

Documentation Status Updates

Helpers for Advent of Codee

Features

  • Calculate manhattan distance

    >>> distances.manhattan((-3, 1), (0, 0))
    
    4
  • Generate neighbors

    >>> list(neighbors.neighbors((1, 1)))
    
    [(1, 0), (0, 1), (2, 1), (1, 2)]
    
    >>> list(neighbors.neighbors((1, 1), 8))
    
    [
        (0, 0),
        (1, 0),
        (2, 0),
        (0, 1),
        (2, 1),
        (0, 2),
        (1, 2),
        (2, 2)
    ]
    
    >>> list(neighbors.neighbors((1, 1), p_min=(1, 1)))
    
    [(2, 1), (1, 2)]
  • Generate points in path

    >>> list(paths.path_points((0, 0), 'R2'))
    
    [(1, 0), (2, 0)]

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

About

Simple helper functions for Advent of Code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published