From f8c8838e3a5366d824f99ab76d017589d0fb75b2 Mon Sep 17 00:00:00 2001 From: Martin Wickham Date: Tue, 30 Nov 2021 18:26:28 -0600 Subject: [PATCH] Also add int/float parsing functions --- src/day01.zig | 3 +++ src/day02.zig | 3 +++ src/day03.zig | 3 +++ src/day04.zig | 3 +++ src/day05.zig | 3 +++ src/day06.zig | 3 +++ src/day07.zig | 3 +++ src/day08.zig | 3 +++ src/day09.zig | 3 +++ src/day10.zig | 3 +++ src/day11.zig | 3 +++ src/day12.zig | 3 +++ src/day13.zig | 3 +++ src/day14.zig | 3 +++ src/day15.zig | 3 +++ src/day16.zig | 3 +++ src/day17.zig | 3 +++ src/day18.zig | 3 +++ src/day19.zig | 3 +++ src/day20.zig | 3 +++ src/day21.zig | 3 +++ src/day22.zig | 3 +++ src/day23.zig | 3 +++ src/day24.zig | 3 +++ src/day25.zig | 3 +++ src/util.zig | 3 +++ 26 files changed, 78 insertions(+) diff --git a/src/day01.zig b/src/day01.zig index dcb7274..b2d5b77 100644 --- a/src/day01.zig +++ b/src/day01.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day02.zig b/src/day02.zig index a128d6c..7a6ba57 100644 --- a/src/day02.zig +++ b/src/day02.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day03.zig b/src/day03.zig index 2c61289..e1c4c46 100644 --- a/src/day03.zig +++ b/src/day03.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day04.zig b/src/day04.zig index 9deadf5..8ba3c9d 100644 --- a/src/day04.zig +++ b/src/day04.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day05.zig b/src/day05.zig index f673aed..deaf893 100644 --- a/src/day05.zig +++ b/src/day05.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day06.zig b/src/day06.zig index 9e8be99..68f8ecd 100644 --- a/src/day06.zig +++ b/src/day06.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day07.zig b/src/day07.zig index 591fb37..9f19621 100644 --- a/src/day07.zig +++ b/src/day07.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day08.zig b/src/day08.zig index d876eea..103b835 100644 --- a/src/day08.zig +++ b/src/day08.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day09.zig b/src/day09.zig index 1735350..cbae5ba 100644 --- a/src/day09.zig +++ b/src/day09.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day10.zig b/src/day10.zig index e9f95f5..4922906 100644 --- a/src/day10.zig +++ b/src/day10.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day11.zig b/src/day11.zig index 55102d5..6e7dd52 100644 --- a/src/day11.zig +++ b/src/day11.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day12.zig b/src/day12.zig index 8e4c32d..f6836d0 100644 --- a/src/day12.zig +++ b/src/day12.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day13.zig b/src/day13.zig index e62a13a..d9c017f 100644 --- a/src/day13.zig +++ b/src/day13.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day14.zig b/src/day14.zig index b48eed5..d791082 100644 --- a/src/day14.zig +++ b/src/day14.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day15.zig b/src/day15.zig index 5c24786..3b9f098 100644 --- a/src/day15.zig +++ b/src/day15.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day16.zig b/src/day16.zig index eeaa678..f5f9671 100644 --- a/src/day16.zig +++ b/src/day16.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day17.zig b/src/day17.zig index 0b9c9e7..3c5187c 100644 --- a/src/day17.zig +++ b/src/day17.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day18.zig b/src/day18.zig index 4f43cca..e2c4d36 100644 --- a/src/day18.zig +++ b/src/day18.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day19.zig b/src/day19.zig index 379b06e..e247aac 100644 --- a/src/day19.zig +++ b/src/day19.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day20.zig b/src/day20.zig index ff2e7e0..f7a9ac4 100644 --- a/src/day20.zig +++ b/src/day20.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day21.zig b/src/day21.zig index b02295c..af7d628 100644 --- a/src/day21.zig +++ b/src/day21.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day22.zig b/src/day22.zig index 1994ed6..fb4986f 100644 --- a/src/day22.zig +++ b/src/day22.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day23.zig b/src/day23.zig index 9fffb21..b1ecf7d 100644 --- a/src/day23.zig +++ b/src/day23.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day24.zig b/src/day24.zig index 38f1804..caabe67 100644 --- a/src/day24.zig +++ b/src/day24.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/day25.zig b/src/day25.zig index 9126594..768b4d9 100644 --- a/src/day25.zig +++ b/src/day25.zig @@ -28,6 +28,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max; diff --git a/src/util.zig b/src/util.zig index dc11ea4..5a1b157 100644 --- a/src/util.zig +++ b/src/util.zig @@ -25,6 +25,9 @@ const trim = std.mem.trim; const sliceMin = std.mem.min; const sliceMax = std.mem.max; +const parseInt = std.fmt.parseInt; +const parseFloat = std.fmt.parseFloat; + const min = std.math.min; const min3 = std.math.min3; const max = std.math.max;