8个不稳定版本 (3个重大更新)
0.4.0 | 2023年12月10日 |
---|---|
0.3.1 | 2023年11月25日 |
0.2.0 | 2023年10月23日 |
0.1.3 | 2023年10月22日 |
#589 in 过程宏
每月82次下载
20KB
463 代码行
aors - Advent of RS 🎄 🦀
Advent of Code的有用rs工具。
安装与设置
cargo install aors # Install CLI
aors --init # Create a new project at current directory.
aors --year <YEAR> # Set year to solve
aors --cookie <COOKIE> # Set session cookie
COOKIE是你的会话cookie,可以从Advent of Code网站这样获取。
此命令之后的第一个命令可能需要一些时间才能输出。这是完全正常的。
用法
aors # run all days
aors [DAYS] # run one or more specific days
aors [DAYS] -x # run with example input (--example also works)
aors [DAYS] -g # get input and create necessary files (--get also works)
# input_examples/<DAY>.in has to be filled in manually
aors [DAYS] -p # post output to Advent of Code (--post also works)
# submits part 2 if part 1 has already been submitted
phi()
函数
有时谜题需要为示例问题和实际问题使用不同的变量,而不仅仅是输入值。内置函数phi()
用于处理这种情况。
phi()
接受两个相同类型的输入actual
和example
。在解决实际问题时代码返回actual
,在使用示例输入时返回example
。
辅助函数
如果某个函数需要在多天内使用,则应将其放在helpers
文件夹中。
初始项目结构和设置是从AxlLind那里友好地窃取的。然而,它已经得到了极大的扩展。
依赖关系
~6–9MB
~178K SLoC