/media/sda-magnetic/david/Dok-15-2023-11-27/fernuni-hagen/cs-i-ii/old-cs-2-03/quine-mc-cluskey-asm-2021-04-16/aufg15.c


#include <stdio.h>
#include <stdlib.h>
#include <time.h>

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


int main (void) {
    int x0, x1, x2, x3, x4;
    time_t t;
    int i;

    
    srand((unsigned) time(&t));
    
    for (i = 0, x4 = 0;  x4 <= 1;  x4++) {
        for (x3 = 0;  x3 <= 1;  x3++) {
            for (x2 = 0;  x2 <= 1;  x2++) {
                for (x1 = 0;  x1 <= 1;  x1++, i++) {
                    //for (x0 = 0;  x0 <= 1;  x0++, i++) {
                        printf( "%2i %i %i %i %i", i, x4, x3, x2, x1);   
                        printf( "  %i\n", ((x1 or x2) and x3) or (x2 and (x3 or x4)));
                    //}
                }
            }
        }
    }
}