table
This commit is contained in:
parent
3fce97aa4a
commit
b9b0d8f815
@ -1,4 +1,4 @@
|
|||||||
echo "BUILDING LOGIC"
|
echo "BUILDING LOGIC"
|
||||||
clang ./logic.c ./logic_symb.c ./logic_run.c ./logic_ops.c ./logic_karn.c -o ./logic.elf
|
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"
|
echo "LOGIC HAS BEEN BUILT - NOW WE GONNA RUN IT"
|
||||||
./logic
|
./logic.elf
|
@ -10,12 +10,45 @@ int logic_karn_2_gray[] = {0b00, 0b01, 0b11, 0b10};
|
|||||||
void logic_karn_render(bool* karn, int x, int y)
|
void logic_karn_render(bool* karn, int x, int y)
|
||||||
{
|
{
|
||||||
bool *c = karn;
|
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++)
|
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++)
|
for (int iy = 0; iy < y; iy++)
|
||||||
{
|
{
|
||||||
printf("| %d ", *c);
|
if (*c == 1)
|
||||||
|
{
|
||||||
|
printf("| 1 ");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("| ");
|
||||||
|
}
|
||||||
|
|
||||||
c++; // lmao
|
c++; // lmao
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user