This commit is contained in:
Rose Apollo 2024-11-30 22:13:38 +00:00
parent b9b0d8f815
commit e649b1a3bd
2 changed files with 7 additions and 7 deletions

View File

@ -7,7 +7,7 @@
int main(int argc, char** argv)
{
int x, y;
char d[] = "((Bo((-A^-C)o(A^C)))v(A^B^C))^((DvA)o(-D^C))";
char d[] = "(D^B)v(B^-C)v(B^(-C^-D))v(A^C^D)v(-C^D^-A^-B)";
bool* c = logic_karn_run(d, 4, &x, &y);
logic_karn_render(c, x, y);

View File

@ -83,24 +83,24 @@ bool* logic_karn_run(char* equ, int args, int *x, int *y)
{
if (*x == 2)
{
bargs[0] = logic_karn_1_gray[ix];
bargs[((*y) / 2) + 0] = logic_karn_1_gray[ix];
}
else
{
bargs[0] = logic_karn_2_gray[ix] & (1 << 0);
bargs[1] = logic_karn_2_gray[ix] & (1 << 1);
bargs[((*y) / 2) + 0] = logic_karn_2_gray[ix] & (1 << 0);
bargs[((*y) / 2) + 1] = logic_karn_2_gray[ix] & (1 << 1);
}
for (int iy = 0; iy < *y; iy++)
{
if (*y == 2)
{
bargs[((*x) / 2) + 0] = logic_karn_1_gray[iy];
bargs[0] = logic_karn_1_gray[iy];
}
else
{
bargs[((*x) / 2) + 0] = logic_karn_2_gray[iy] & (1 << 0);
bargs[((*x) / 2) + 1] = logic_karn_2_gray[iy] & (1 << 1);
bargs[0] = logic_karn_2_gray[iy] & (1 << 0);
bargs[1] = logic_karn_2_gray[iy] & (1 << 1);
}
*dp = logic_run_runner(equ, args, bargs);