Skip to content

Commit 5682c78

Browse files
committed
Revised clockhands
1 parent 8424cb7 commit 5682c78

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

zig/clockhands.zig

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
const bufPrint = @import("std").debug.print;
1+
const print = @import("std").debug.print;
22

33
pub fn main() void {
44
for (0..11) |i| {
5-
const t = (i * 43200 + 21600) / 11;
5+
const t = (43200 * i + 21600) / 11;
66
const h = t / 3600;
7-
const m = t % 3600;
8-
bufPrint("{d:0>2}:{d:0>2}:{d:0>2}\n", .{ if (h == 0) 12 else h, m / 60, m % 60 });
7+
const m = t / 60 % 60;
8+
const s = t % 60;
9+
print("{d:0>2}:{d:0>2}:{d:0>2}\n", .{ if (h == 0) 12 else h, m, s });
910
}
1011
}

0 commit comments

Comments
 (0)