summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2022-09-25 17:40:27 +0200
committerLouis Burda <quent.burda@gmail.com>2022-09-25 17:40:27 +0200
commit60b74531aa329e626650a4e0ecdcfd99d984e037 (patch)
treec5c4002ef17c577e3b3ab81c30789326d28ce5fc
parentfcda8c004690c428aea0ad3a50d27395f5502d48 (diff)
downloadpietp-60b74531aa329e626650a4e0ecdcfd99d984e037.tar.gz
pietp-60b74531aa329e626650a4e0ecdcfd99d984e037.zip
Add missing colored, initial pixel
-rw-r--r--.gitignore2
-rw-r--r--piet.pngbin183 -> 0 bytes
-rw-r--r--pietp.c8
3 files changed, 7 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index a71bbae..e478a33 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,3 @@
pietp
+*.png
+!map.png
diff --git a/piet.png b/piet.png
deleted file mode 100644
index 3ed773f..0000000
--- a/piet.png
+++ /dev/null
Binary files differ
diff --git a/pietp.c b/pietp.c
index d2003a4..10761f1 100644
--- 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))