exercism/zig/word-count/strings.zig
2024-07-28 17:45:02 -04:00

14 lines
436 B
Zig

const std = @import("std");
const print = std.debug.print;
const countWords = @import("./word_count.zig").countWords;
pub fn main() !void {
const alloc = std.heap.page_allocator;
const m = try countWords(alloc, "go Go GO Stop stop");
print("count: {d}\n", .{m.count()});
var iter = m.keyIterator();
while (iter.next()) |k| {
print("{s}: {d}\n", .{ k.*, m.get(k.*).? });
}
// print("{any}", .{m});
}