Skip to main content

Helpers for Advent of Codee

Project description

santa-helpers

https://img.shields.io/pypi/v/santa_helpers.svg https://img.shields.io/travis/lenarother/santa_helpers.svg 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.

History

0.0.1 (2022-02-02)

  • First release on PyPI.

  • neighbors

  • parsing to dict

0.0.2 (2022-03-08)

  • manhattan distance

  • points in path

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

santa_helpers-0.0.2.tar.gz (17.2 kB view hashes)

Uploaded Source

Built Distribution

santa_helpers-0.0.2-py2.py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page