diff --git a/src/build.sh b/src/build.sh index 5291716..4a68106 100644 --- a/src/build.sh +++ b/src/build.sh @@ -1,4 +1,4 @@ echo "BUILDING LOGIC" clang ./logic.c ./logic_symb.c ./logic_run.c ./logic_ops.c ./logic_karn.c -o ./logic.elf echo "LOGIC HAS BEEN BUILT - NOW WE GONNA RUN IT" -./logic \ No newline at end of file +./logic.elf \ No newline at end of file diff --git a/src/logic_karn.c b/src/logic_karn.c index c1bec30..2dd96d2 100644 --- a/src/logic_karn.c +++ b/src/logic_karn.c @@ -10,12 +10,45 @@ int logic_karn_2_gray[] = {0b00, 0b01, 0b11, 0b10}; void logic_karn_render(bool* karn, int x, int y) { bool *c = karn; + + printf("| "); + + for (int iy = 0; iy < y; iy++) + { + if (y == 2) + { + printf("| %d ", (logic_karn_1_gray[iy] & (1))); + } + else + { + printf("|%d%d ", (logic_karn_2_gray[iy] & (1 << 0)), ((logic_karn_2_gray[iy] & (1 << 1)) / 2)); + } + } + + printf("|\n"); for (int ix = 0; ix < x; ix++) { + if (x == 2) + { + printf("| %d ", (logic_karn_1_gray[ix] & (1))); + } + else + { + printf("|%d%d ", (logic_karn_2_gray[ix] & (1 << 0)), ((logic_karn_2_gray[ix] & (1 << 1)) / 2)); + } + for (int iy = 0; iy < y; iy++) { - printf("| %d ", *c); + if (*c == 1) + { + printf("| 1 "); + } + else + { + printf("| "); + } + c++; // lmao }