ALLEGRO_DATE(3alleg4)

πŸ’– ALLEGRO_DATE πŸ’–

ok so bestie, welcome to the Allegro manual ✨ this one's a lil macro page from ALLEGRO_DATE(3alleg4) and it's genuinely so cute and useful, i promise.


🌸 NAME 🌸

ALLEGRO_DATE β€” it's defined to a number with the release date of Allegro. that's it. that's the whole vibe. a whole timestamp living inside your headers πŸŽ€


✨ SYNOPSIS ✨

#include <allegro.h>

#define ALLEGRO_DATE

like yes she's just a #define, she's lowkey iconic for it πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea: ALLEGRO_DATE is defined to an integer holding the release date of Allegro, packed up all snug in the format yyyymmdd. she's giving compressed calendar energy fr fr πŸ—“οΈβœ¨

so if you wanna crack her open and pull out the actual year, month and day, you do the math thing. like this:

const int year = ALLEGRO_DATE / 10000;
const int month = (ALLEGRO_DATE / 100) % 100;
const int day = ALLEGRO_DATE % 100;

allegro_message("Year %d, month %d, day %d\n",
   year, month, day);

see how she works?? divide by 10000 for the year, then (ALLEGRO_DATE / 100) % 100 for the month, then ALLEGRO_DATE % 100 for the day. integer math doing the absolute most and honestly? she ate πŸ’… no cap.

bestie reminder: copy those lines exactly as they are, the numbers matter, don't be out here freelancing your own arithmetic 😭

and that's the whole page, you're officially a ALLEGRO_DATE girlie now 🫢

this lil drop came from Allegro, version 4.4.3 β€” mwah, love her, stan her, go read the rest of the manual when you're done being obsessed with this one 🌈⭐ bye bestie!! πŸ’–