diff --git a/.gitignore b/.gitignore index fe33983..237357a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ !*.md !*.nix !*.nu +!*.py diff --git a/2023/1-1.py b/2023/1-1.py new file mode 100644 index 0000000..2cbfb79 --- /dev/null +++ b/2023/1-1.py @@ -0,0 +1 @@ +print(sum(int(__import__("functools").reduce(lambda x,y: x+y,(lambda a:[a[0],a[-1]])(list(filter(lambda c:c.isdigit(),l)))))for l in __import__("pathlib").Path("1-1.in").read_text().splitlines())) diff --git a/run.nu b/run.nu index 17619a9..40cc958 100755 --- a/run.nu +++ b/run.nu @@ -10,7 +10,7 @@ def main [ } "py" => { cd ($year_day_part_ext | path dirname) - python $year_day_part_ext + python ($year_day_part_ext | path basename) cd - } }