/media/sda-magnetic/david/Dok-15-2023-11-27/fernuni-hagen/cs-i-ii/fsm/fsm/2021-04-24-state/aufg-solve2.c


#include <stdio.h>

#define and &&
#define or ||
#define not !

int main (void) {
        int x, z2, z1, z0;
 /*       
        for (z2 = 0;  z2 <= 1;  z2++) {
            for (z1 = 0;  z1 <= 1;  z1++) {
                for (z0 = 0;  z0 <= 1;  z0++) {
                    for (x = 0;  x <= 1;  x++) {
                        printf ("%i %i %i %i   %i %i %i %i\n", z2, z1, z0, x, (x and z0) or ((not x) and z1) or ((not x) and z2), ((not x) and z0) or (x and z1), x and z2, z0 or ((not x) and z1) or z2);
                    }
                }
            }
        }
*/
 
 x = 0;
 z0 = 1;
 z1 = 0;
 z2 = 0;
 printf ("%i %i %i %i   %i %i %i %i\n", z2, z1, z0, x, (x and z0) or ((not x) and z1) or ((not x) and z2), ((not x) and z0) or (x and z1), x and z2, z0 or ((not x) and z1) or z2);

 x = 1;
 z0 = 1;
 z1 = 0;
 z2 = 0; 
 printf ("%i %i %i %i   %i %i %i %i\n", z2, z1, z0, x, (x and z0) or ((not x) and z1) or ((not x) and z2), ((not x) and z0) or (x and z1), x and z2, z0 or ((not x) and z1) or z2);

 x = 0;
 z0 = 0;
 z1 = 1;
 z2 = 0;
 printf ("%i %i %i %i   %i %i %i %i\n", z2, z1, z0, x, (x and z0) or ((not x) and z1) or ((not x) and z2), ((not x) and z0) or (x and z1), x and z2, z0 or ((not x) and z1) or z2);

 x = 1;
 z0 = 0;
 z1 = 1;
 z2 = 0; 
 printf ("%i %i %i %i   %i %i %i %i\n", z2, z1, z0, x, (x and z0) or ((not x) and z1) or ((not x) and z2), ((not x) and z0) or (x and z1), x and z2, z0 or ((not x) and z1) or z2);

 x = 0;
 z0 = 0;
 z1 = 0;
 z2 = 1;
 printf ("%i %i %i %i   %i %i %i %i\n", z2, z1, z0, x, (x and z0) or ((not x) and z1) or ((not x) and z2), ((not x) and z0) or (x and z1), x and z2, z0 or ((not x) and z1) or z2);

 x = 1;
 z0 = 0;
 z1 = 0;
 z2 = 1; 
 printf ("%i %i %i %i   %i %i %i %i\n", z2, z1, z0, x, (x and z0) or ((not x) and z1) or ((not x) and z2), ((not x) and z0) or (x and z1), x and z2, z0 or ((not x) and z1) or z2);

 
return 0;
}