Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.2 kB
1
Indexable
Never
#include <stdio.h>
#include <stdlib.h>

void delay(int seconds) {
    int milli_seconds = 1000 * seconds;
    clock_t start_time = clock();
    while (clock() < start_time + milli_seconds);
}

int main() {
    int i, j;
    for (i = 0; i < 10; i++) {
        system("cls"); // clears the console screen for Windows OS
        // system("clear"); // clears the console screen for Linux and macOS
        for (j = 0; j < i; j++) {
            printf(" ");
        }
        printf("  _____\n");
        for (j = 0; j < i; j++) {
            printf(" ");
        }
        printf(" /     \\\n");
        for (j = 0; j < i; j++) {
            printf(" ");
        }
        printf("|       |\n");
        for (j = 0; j < i; j++) {
            printf(" ");
        }
        printf("|  O O  |\n");
        for (j = 0; j < i; j++) {
            printf(" ");
        }
        printf("|   <   |\n");
        for (j = 0; j < i; j++) {
            printf(" ");
        }
        printf("|  ---  |\n");
        for (j = 0; j < i; j++) {
            printf(" ");
        }
        printf(" \\_____/ \n");
        delay(500); // wait for 0.5 seconds
    }
    return 0;
}