Add aliases for useful std lib functions
This commit is contained in:
parent
70a6319806
commit
504784b28e
26 changed files with 651 additions and 52 deletions
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day01.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day02.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day03.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day04.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day05.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day06.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day07.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day08.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day09.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day10.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day11.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day12.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day13.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day14.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day15.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day16.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day17.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day18.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day19.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day20.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day21.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day22.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day23.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day24.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -16,3 +14,28 @@ const data = @embedFile("../data/day25.txt");
|
|||
pub fn main() !void {
|
||||
|
||||
}
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
28
src/util.zig
28
src/util.zig
|
@ -1,7 +1,5 @@
|
|||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const assert = std.debug.assert;
|
||||
const print = std.debug.print;
|
||||
const List = std.ArrayList;
|
||||
const Map = std.AutoHashMap;
|
||||
const StrMap = std.StringHashMap;
|
||||
|
@ -12,3 +10,29 @@ var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){};
|
|||
pub const gpa = &gpa_impl.allocator;
|
||||
|
||||
// Add utility functions here
|
||||
|
||||
|
||||
// Useful stdlib functions
|
||||
const tokenize = std.mem.tokenize;
|
||||
const split = std.mem.split;
|
||||
const indexOf = std.mem.indexOfScalar;
|
||||
const indexOfAny = std.mem.indexOfAny;
|
||||
const indexOfStr = std.mem.indexOfPosLinear;
|
||||
const lastIndexOf = std.mem.lastIndexOfScalar;
|
||||
const lastIndexOfAny = std.mem.lastIndexOfAny;
|
||||
const lastIndexOfStr = std.mem.lastIndexOfLinear;
|
||||
const trim = std.mem.trim;
|
||||
const sliceMin = std.mem.min;
|
||||
const sliceMax = std.mem.max;
|
||||
|
||||
const min = std.math.min;
|
||||
const min3 = std.math.min3;
|
||||
const max = std.math.max;
|
||||
const max3 = std.math.max3;
|
||||
|
||||
const print = std.debug.print;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
const sort = std.sort.sort;
|
||||
const asc = std.sort.asc;
|
||||
const desc = std.sort.desc;
|
||||
|
|
Loading…
Reference in a new issue