Ejemplo n.º 1
0
int main(void) {
	//Try out some different shifts for each pattern to spot the best ones:
	printPattern(1, 1, 0);
	printf("\n");
	printPattern(1, 2, 0);
	printPattern(1, 2, 1);
	printf("\n");
	printPattern(1, 3, 0);
	printPattern(1, 3, 1);
	printPattern(1, 3, 2);
	printf("\n");
	printPattern(2, 3, 0);
	printPattern(2, 3, 1);
	printPattern(2, 3, 2);
	printf("\n");
	printPattern(1, 4, 0);
	printPattern(1, 4, 1);
	printPattern(1, 4, 2);
	printPattern(1, 4, 3);
	printf("\n");
	printPattern(2, 4, 0);
	printPattern(2, 4, 1);
	printPattern(2, 4, 2);
	printPattern(2, 4, 3);
	printf("\n");
	printPattern(3, 4, 0);
	printPattern(3, 4, 1);
	printPattern(3, 4, 2);
	printPattern(3, 4, 3);
	printf("\n");
	printPattern(1, 8, 0);
	printPattern(1, 8, 1);
	printPattern(1, 8, 2);
	printPattern(1, 8, 3);
	printf("\n");
	printPattern(2, 8, 0);
	printPattern(2, 8, 1);
	printPattern(2, 8, 2);
	printPattern(2, 8, 3);
	printf("\n");
	printf("\n");

	//Try an algorithm that picks the best shift itself:
	for (int denom = 1; denom <= 8; denom++)
		for (int num = 1; num <= denom; num++)
			printPattern2(num, denom);
	printf("\n");

	//This should be the ugliest case
    printPattern2(IFRAME_INTERVAL / 2 - 1, IFRAME_INTERVAL);

	return 0;
}
Ejemplo n.º 2
0
int main()
{

  printPattern1();
  printf("\n");
  printPattern2();
  printf("\n");
  printPattern3();
  printf("\n");
 
  return 0;
}