commit 60b74531aa329e626650a4e0ecdcfd99d984e037
parent fcda8c004690c428aea0ad3a50d27395f5502d48
Author: Louis Burda <quent.burda@gmail.com>
Date: Sun, 25 Sep 2022 17:40:27 +0200
Add missing colored, initial pixel
Diffstat:
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -1 +1,3 @@
pietp
+*.png
+!map.png
diff --git a/piet.png b/piet.png
Binary files differ.
diff --git a/pietp.c b/pietp.c
@@ -94,7 +94,7 @@ main(int argc, const char **argv)
int color;
if (argc != 2) {
- fprintf(stderr, "Usage: piet-painter MAP-IMAGE");
+ fprintf(stderr, "Usage: pietp MAP-IMAGE");
exit(1);
}
@@ -106,9 +106,11 @@ main(int argc, const char **argv)
dx = 1;
dy = 0;
- insti = 0;
- x = y = 0;
color = 0;
+ x = y = 0;
+ setrgb(pix, width * 3, x++, y, color);
+
+ insti = 0;
while (1) {
if (vis_map[y * width + x]) {
if (insti >= ARRLEN(piet_code))