diff --git a/2025/go.mod b/2025/go.mod deleted file mode 100644 index 05b41ba..0000000 --- a/2025/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module forgejo.gwairfelin.com/aoc - -go 1.25.4 diff --git a/2025/one.go b/2025/one.go deleted file mode 100644 index d579838..0000000 --- a/2025/one.go +++ /dev/null @@ -1,61 +0,0 @@ -package main - -import ( - "bufio" - "log" - "os" - "strconv" -) - -func mod(a int, b int) int { - return (a%b + b) % b -} - -func One() { - cur := 50 - n_zeroes := 0 - - file, err := os.Open("one.txt") - if err != nil { - log.Fatal(err) - } - defer file.Close() - - scanner := bufio.NewScanner(file) - - for scanner.Scan() { - text := scanner.Text() - - num, err := strconv.Atoi(text[1:]) - if err != nil { - log.Fatal(err) - } - - var next_pre_modulo int = 0 - if text[0] == 'R' { - next_pre_modulo = cur + num - n_zeroes += next_pre_modulo / 100 - } else { - next_pre_modulo = cur - num - if next_pre_modulo <= 0 { - extra := (next_pre_modulo / -100) - - // Omg you sneaky fuck! We only add one if we didn't start on - // 0 already. - if cur != 0 { - extra += 1 - } - - n_zeroes += extra - } - } - - cur = mod(next_pre_modulo, 100) - log.Printf("Next pre mod: %d, post mod: %d, n zeroes: %d", next_pre_modulo, cur, n_zeroes) - } - -} - -func main() { - One() -}