Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <windows.h>
- #define DEBUG 1
- #define FIN_ANIMACION 0
- #define FPS 100 // Si no fuera TAN cutre dibujando (O mas bien borrando) Windows, la tasa de frames seria real
- char CIRC0[] = " _";
- char CIRC1[] = " _\n \\";
- char CIRC2[] = " _\n \\\n |";
- char CIRC3[] = " _\n \\\n |\n /";
- char CIRC4[] = " _\n \\\n |\n _/";
- char CIRC5[] = " _\n \\\n |\n\\_/";
- char CIRC6[] = " _\n \\\n| |\n\\_/";
- char CIRC7[] = " _\n/ \\\n| |\n\\_/";
- char CIRC8[] = "\n/ \\\n| |\n\\_/";
- char CIRC9[] = "\n/\n| |\n\\_/";
- char CIRC10[] = "\n/\n|\n\\_/";
- char CIRC11[] = "\n/\n|\n\\_";
- char CIRC12[] = "\n/\n|\n\\";
- char CIRC13[] = "\n/\n|";
- char CIRC14[] = "\n/";
- char *CIRCULO[] = {CIRC0, CIRC1, CIRC2, CIRC3, CIRC4, CIRC5, CIRC6, CIRC7,
- CIRC8, CIRC9, CIRC10, CIRC11, CIRC12, CIRC13, CIRC14, FIN_ANIMACION};
- void dibujar_anim(char *animacion[], int repeticiones)
- {
- int i;
- int frame = 0;
- for (i=0; i<repeticiones; i++)
- {
- while (animacion[frame] != FIN_ANIMACION)
- {
- system ("cls");
- if (DEBUG)
- printf ("Frame %d (x%d)\n", frame, i);
- printf (animacion[frame]);
- Sleep (1000/FPS);
- frame++;
- }
- frame = 0;
- }
- return;
- }
- int main (void)
- {
- dibujar_anim(CIRCULO, 10);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement