added patches

This commit is contained in:
λmolinae 2025-03-12 08:38:50 -06:00
parent f68f49273e
commit 8c6890f943
13 changed files with 395 additions and 205 deletions

30
components/kanji.c Normal file
View file

@ -0,0 +1,30 @@
/* Written by Madison Lynch <madi@mxdi.xyz> */
#include <time.h>
static const char *symbols[] = {
"", // Sunday
"", // Monday
"", // Tuesday
"", // Wednesday
"", // Thursday
"", // Friday
"" // Saturday
};
/**
* Returns the appropriate Japanese Kanji character correlating with the current
* day of the week.
*
* @param unused (NULL)
* @return the appropriate Kanji character (char)
* @author Madison Lynch
*/
const char *
kanji(const char *unused) {
const time_t current_time = time(NULL);
const unsigned int weekday = localtime(
&current_time
)->tm_wday;
return (weekday < sizeof(symbols) / sizeof(char *)) ? symbols[weekday] : "?";
}