Skip to content

Instantly share code, notes, and snippets.

@cuter44
Last active May 5, 2017 17:31
Show Gist options
  • Save cuter44/4da2b633a233e8f0220b65f19a099cb5 to your computer and use it in GitHub Desktop.
Save cuter44/4da2b633a233e8f0220b65f19a099cb5 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
int d0[18];
int d1[6];
int t;
for (int i=0; i<18; i++)
d0[i] = rand() % 2;
for (int i=0; i<6; i++)
{
t = d0[i*3] + d0[i*3+1] + d0[i*3+2];
d1[i] = 6 + t%2*2 + t/2;
printf("%d", d1[i]);
}
printf("\n");
return(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment