#include <stdio.h>
#include <math.h>
#include <unistd.h>  // for sleep/usleep

int main(void) {
    double x, y;

    // Animate filling
    for (double fill = 1.5; fill >= -1.5; fill -= 0.1) {
        printf("\033[2J\033[H");  // clear screen
        for (y = 1.5; y > -1.5; y -= 0.05) {
            for (x = -1.5; x < 1.5; x += 0.025) {
                double a = x*x + y*y - 1;
                double value = a*a*a - x*x*y*y*y;
                if (value <= 0.0 && y < fill)
                    printf("\033[1;31m*\033[0m"); // red color
                else
                    printf(" ");
            }
            printf("\n");
        }
        usleep(80000); // controls speed
    }

    // Final heart with message
    printf("\033[2J\033[H");
    for (y = 1.5; y > -1.5; y -= 0.05) {
        for (x = -1.5; x < 1.5; x += 0.025) {
            double a = x*x + y*y - 1;
            double value = a*a*a - x*x*y*y*y;
            if (value <= 0.0)
                printf("\033[1;31m*\033[0m");
            else
                printf(" ");
        }
        printf("\n");
    }

    printf("\n\n\033[1;35m     I LOVE YOU ❤️\033[0m\n\n");
    return 0;
}