/* This program generates and displays n-point skip-s stars, in color. Use the tiny-c program http://primepuzzle.com/tc/star.tc to determine n,s pairs that are valid. Example output: http://primepuzzle.com/tc/kristen.html */ // altered on 5/6/19 to use a 40x40 display #include #include #include #include char ar[40][40];int car[40][40]; hilo (char c) {putchar(0x1B);putchar(0x5B);putchar(c);putchar('m');} color (char c) {putchar(0x1B);putchar(0x5B);putchar('3');putchar(c);putchar('m');} int rwb (int k) { // red, white, and blue switch(k) { case 0 : return 1; case 1 : return 4; case 2 : return 7; } } void plot (double xo,double yo,double xn,double yn,int k) { double x,y,b,m,inc;int i,j; if (abs(xn-xo)<1) { inc=yo=0;--j) { printf(" "); for (i=0;i<=39;++i) {color('0'+car[j][i]);printf("%c ",ar[j][i]);} printf("\n"); } printf("\n");color('3'); // yellow printf("\nBe a star!\n"); hilo('0'); // turn off highlighting }