diff options
Diffstat (limited to '2022')
-rwxr-xr-x | 2022/get | 16 | ||||
-rw-r--r-- | 2022/main.nim | 16 | ||||
-rw-r--r-- | 2022/main.rs | 8 | ||||
-rwxr-xr-x | 2022/one | 7 | ||||
-rwxr-xr-x | 2022/run | 5 | ||||
-rwxr-xr-x | 2022/two | 7 | ||||
-rwxr-xr-x | 2022/vars | 4 | ||||
-rwxr-xr-x | 2022/watch | 7 |
8 files changed, 0 insertions, 70 deletions
diff --git a/2022/get b/2022/get deleted file mode 100755 index b1eff41..0000000 --- a/2022/get +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -source "vars" -INPUT_URL="https://adventofcode.com/${YEAR}/day/$((10#${DAY}))/input" - -mkdir "nim/day${DAY}" -cp "main.nim" "nim/day${DAY}/main.nim" -curl $INPUT_URL --cookie "session=${TOKEN}" > "nim/day${DAY}/input.txt" - -cargo new "rust/day${DAY}" -cp "main.rs" "rust/day${DAY}/src/main.rs" -cp "nim/day${DAY}/input.txt" "rust/day${DAY}/src/input.txt" - -subl -a "nim/day${DAY}/input.txt" -subl -a "nim/day${DAY}/main.nim" -# chromium "https://adventofcode.com/${YEAR}/day/$((10#${DAY}))" diff --git a/2022/main.nim b/2022/main.nim deleted file mode 100644 index 15ba6b9..0000000 --- a/2022/main.nim +++ /dev/null @@ -1,16 +0,0 @@ -# Day ???: ??? -import std/[os, strutils, sequtils, sugar] -# import std/[algorithm, math, hashes, tables, sets] -# import std/[strformat, strscans, enumerate] - -# useful functions and things to remember: -# - readFile, splitLines, split(""), strip({''}) -# - map(func), filter(func), all(func), any(func) -# - foldl(func, init), string.repeat(count), zip(a, b) -# for i, chr in "string": assert "string"[i] == chr -# assert @[0, 1, 2, 3] == collect(for i in 0..3: i) - -let input = paramStr(1).readFile().strip().split("\n") - -for line in input: - discard diff --git a/2022/main.rs b/2022/main.rs deleted file mode 100644 index 2cad662..0000000 --- a/2022/main.rs +++ /dev/null @@ -1,8 +0,0 @@ -use std::env; -use std::fs; - -fn main() { - let args = env::args().nth(1).expect(""); - let input = fs::read_to_string(args).expect(""); - println!("{}", input); -} diff --git a/2022/one b/2022/one deleted file mode 100755 index 6b7db35..0000000 --- a/2022/one +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -source "vars" -LEVEL="1" -SUBMIT_URL="https://adventofcode.com/${YEAR}/day/$((10#${DAY}))/answer" - -curl $SUBMIT_URL --cookie "session=${TOKEN}" --data "level=${LEVEL}&answer=$1" | rg -C 1 "main" diff --git a/2022/run b/2022/run deleted file mode 100755 index 45f80aa..0000000 --- a/2022/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -source "vars" - -nim c --warnings:off --hints:off -r "nim/day${DAY}/main.nim" "nim/day${DAY}/input.txt" diff --git a/2022/two b/2022/two deleted file mode 100755 index 8dd0080..0000000 --- a/2022/two +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -source "vars" -LEVEL="2" -SUBMIT_URL="https://adventofcode.com/${YEAR}/day/$((10#${DAY}))/answer" - -curl $SUBMIT_URL --cookie "session=${TOKEN}" --data "level=${LEVEL}&answer=$1" | rg -C 1 "main" diff --git a/2022/vars b/2022/vars deleted file mode 100755 index 31e8b53..0000000 --- a/2022/vars +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -DAY="01" -YEAR="2022" diff --git a/2022/watch b/2022/watch deleted file mode 100755 index 3792b58..0000000 --- a/2022/watch +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -source "vars" - -while inotifywait --quiet --event modify "~/watched_file" -do ./run -done |