Helpers for Advent of Codee
Project description
santa-helpers
Helpers for Advent of Codee
Free software: MIT license
Documentation: https://santa-helpers.readthedocs.io.
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
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for santa_helpers-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b081ce221a02b3a3f406922d64b86f19a29505ef7eae283f01e6fda164a69d64 |
|
MD5 | 7b3685c71c2e2f59fc6b2b32aeb0d762 |
|
BLAKE2b-256 | 7bd910426d14943fe819f532d6bc4d01a7234c61ff50970fb4d14738cf2fc0c3 |