diff options
| author | nsfisis <nsfisis@gmail.com> | 2022-11-27 11:17:54 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2022-11-27 11:17:54 +0900 |
| commit | b2221bbe25804148f0369fc0d7fd374a470d1974 (patch) | |
| tree | 3f638561a4276cd619a2f2cd50cb113a08affd4a /src/main.zig | |
| parent | 39d1933943a506a0f1f2ce19fe7555f987e1752d (diff) | |
| download | RayTracingInOneWeekend.zig-b2221bbe25804148f0369fc0d7fd374a470d1974.tar.gz RayTracingInOneWeekend.zig-b2221bbe25804148f0369fc0d7fd374a470d1974.tar.zst RayTracingInOneWeekend.zig-b2221bbe25804148f0369fc0d7fd374a470d1974.zip | |
refactor
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main.zig b/src/main.zig index 986a8f6..9110152 100644 --- a/src/main.zig +++ b/src/main.zig @@ -51,18 +51,16 @@ pub fn main() !void { try stdout.print("P3\n{} {}\n255\n", .{ image_width, image_height }); var j: i32 = image_height - 1; - while (j >= 0) { + while (j >= 0) : (j -= 1) { std.debug.print("\rScanlines remaining: {}", .{j}); var i: i32 = 0; - while (i < image_width) { + while (i < image_width) : (i += 1) { try writeColor(stdout, Color{ @intToFloat(f64, i) / (image_width - 1), @intToFloat(f64, j) / (image_height - 1), 0.25, }); - i += 1; } - j -= 1; } try bw.flush(); |
