Advertisement
sp1d3o

donut

Jul 9th, 2022
830
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.01 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <math.h>
  4.  
  5. int k;
  6.  
  7. int main()
  8. {
  9.   float A = 0, B = 0, i, j, z[1760];
  10.   char b[1760];
  11.   printf("\n1b2[J");
  12.   for(;;) {
  13.     memset(b, 32, 1760);
  14.     memset(z, 0, 7040);
  15.     for(j = 0; 6.28 > j; j += 0.004) {
  16.       for(i = 0; 6.28 > i; i+= 0.035) {
  17.       float c = sin(i), d = cos(j), e = sin(A), f = sin(j), g = cos(A),
  18.             h = d + 2, D = 1 / (c * h * e + f * g + 5), l = cos(i),
  19.             m = cos(B), n = sin(B), t = c * h * g - f * e;
  20.       int x = 40 + 30 * D * (l * h * m - t * n);
  21.       int y = 12 + 15 * D * (l *h * n - t * m), o = x + 80 * y,
  22.           N = 8 * ((f * e - c * d * g) * m - c * d * e - f * g - l * d * n);
  23.         if(22 > y && y > 0 && 80 > x && x > 0 && D > z[o]) {
  24.           z[o] = D;
  25.           b[o] = ".,-~:;=!*#$@:"[N > 0 ? N : 0];
  26.         }  
  27.       }  
  28.     }  
  29.     printf("\x1b[H");
  30.     for(k = 0; 1761 > k; k++) {
  31.       putchar(k % 80 ? b[k] : 10);
  32.     }  
  33.     A += 0.04;
  34.     B += 0.02;
  35.   }
  36.   return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement