Inital commit
This commit is contained in:
6
README.md
Normal file
6
README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# Advent of Code
|
||||
|
||||
## 2025
|
||||
|
||||
I did a little bit of 2024 but did not complete it nor save it. This is my first year
|
||||
with the goal of doing all of the challenges and recording it in a repository.
|
||||
70
day
Executable file
70
day
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
me=$0
|
||||
scriptversion="1.0.0"
|
||||
|
||||
version="$me $scriptversion
|
||||
|
||||
Copyright (C) 2025 vx-clutch.
|
||||
This is free software; you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law."
|
||||
|
||||
usage="\
|
||||
Usage: $me [OPTION]...
|
||||
Start a new day
|
||||
|
||||
Options:
|
||||
--help print this help and exit
|
||||
--version output version information
|
||||
"
|
||||
|
||||
while test $# -gt 0; do
|
||||
case $1 in
|
||||
--help) echo "$usage"; exit 0;;
|
||||
--version) echo "$version"; exit 0;;
|
||||
-*)
|
||||
echo "$0: Unknown option '$1'." >&2
|
||||
echo "$0: Try '--help' for more information." >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
mkdir -p $(date "+%Y/%d")
|
||||
cd $(date "+%Y/%d")
|
||||
|
||||
cat <<EOF >solution.py
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import pathlib
|
||||
|
||||
def read_input():
|
||||
path = pathlib.Path(sys.argv[1]) if len(sys.argv) > 1 else pathlib.Path("input.txt")
|
||||
return path.read_text().rstrip("\n")
|
||||
|
||||
def parse(data):
|
||||
return data.splitlines()
|
||||
|
||||
def part1(data):
|
||||
return None
|
||||
|
||||
def part2(data):
|
||||
return None
|
||||
|
||||
def main():
|
||||
raw = read_input()
|
||||
data = parse(raw)
|
||||
r1 = part1(data)
|
||||
r2 = part2(data)
|
||||
print(r1)
|
||||
print(r2)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
EOF
|
||||
|
||||
touch input.txt
|
||||
|
||||
chmod u+x solution.py
|
||||
|
||||
echo "> "$(date "+https://adventofcode.com/%Y/day/%d")
|
||||
Reference in New Issue
Block a user