跳转到主要内容

Advent of Code辅助工具

项目描述

santa-helpers

https://img.shields.io/pypi/v/santa_helpers.svg https://img.shields.io/travis/lenarother/santa_helpers.svg Documentation Status Updates

Advent of Code辅助工具

特性

  • 计算曼哈顿距离

    >>> distances.manhattan((-3, 1), (0, 0))
    
    4
  • 生成邻居

    >>> 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)]
  • 生成路径中的点

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

鸣谢

此包是用Cookiecutteraudreyr/cookiecutter-pypackage项目模板创建的。

历史

0.0.1 (2022-02-02)

  • PyPI上的首次发布。

  • neighbors

  • 解析为字典

0.0.2 (2022-03-08)

  • 曼哈顿距离

  • 路径中的点

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源代码分布

santa_helpers-0.0.2.tar.gz (17.2 kB 查看哈希值)

上传时间: 源代码

构建分布

santa_helpers-0.0.2-py2.py3-none-any.whl (5.4 kB 查看哈希值)

上传于 Python 2 Python 3

由以下支持