Files
ioccc/2024/ferguson2/prog.pre-format.c
Landon Curt Noll 09750f8899 release winning entries of IOCCC28 under the year 2024
Congratulations to:

* 2024/anders - Prize in sound coding - layered music generator
* 2024/burton - Prize in pentagrammatology - wordle hard mode solver
* 2024/cable1 - Prize in bot talk - LLM inference engine
* 2024/cable2 - Prize in murky waters - salmon recipe
* 2024/carlini - Prize in perfect timing - Intel 4004 emulation
* 2024/codemeow - Prize in tray planting - bonsai generator
* 2024/endoh1 - Prize in patient pointillism - slow ray tracer in CPP
* 2024/endoh2 - Prize in solid body physics - rotating rigid body simulation
* 2024/ferguson1 - Prize in diabolical logistics - Oregon trail pact with the devil
* 2024/ferguson2 - Prize in yil-tas - Navajo code talker translator
* 2024/howe - Nice accent eh-ward - mini vi
* 2024/kramer - Prize in linguistic arithmetic - natural language numerical calculator
* 2024/kurdyukov1 - Prize in phased periodicity - phase of the Moon
* 2024/kurdyukov2 - Prize in art restoration - JPEG artifact removal
* 2024/kurdyukov3 - Prize in virtual quietus - gaming VM and doom
* 2024/kurdyukov4 - Prize in embiggening - encode without literals
* 2024/maffiodo - Prize in creative interpretation - Jav\*script interpreter
* 2024/mills - Prize in ℤ₃ - Infocom v3 story interpreter
* 2024/stedolan - Best one liner - icon from MD5
* 2024/straadt - Prize in imitative rebooting - OpenRISC CPU and Linux
* 2024/tmarrec - Prize in cyclonic coding - 3D tornado simulation
* 2024/tompng - Prize in quasi bijection - vortex encryptor decryptor
* 2024/weaver - Sur prize - rickroll

Ran `make update` to perform the above.
 	new file:   2024/burton/.entry.json
2025-08-02 14:43:07 -07:00

139 lines
3.1 KiB
C

#include <string.h>
#include <stdio.h>
#include <strings.h>
#include <stdlib.h>
#include <ctype.h>
int seis, di, biyah, k, lichi, tkoh, j=2**"9"-15;
size_t n, org;
#define L(C) (isupper(C))
#define U(C) (islower(C))
#define M(C) (!isalpha(C))
char *bioh[3**"5"+-132][(1/ *"9")**"A"+2] = {
{ "A", "WOL-LA-CHEE" } ,
{ "B", "SHUSH" } ,
{ "C", "BA-GOSHI" } ,
{ "D", "CHINDI" } ,
{ "E", "AH-JAH" } ,
{ "F", "CHUO" } ,
{ "G", "JEHA" } ,
{ "H", "TSE-GAH" } ,
{ "I", "YEH-HES" } ,
{ "J", "AH-YA-TSINNE" } ,
{ "K", "BA-AH-NE-DI-TININ" } ,
{ "L", "NASH-DOIE-TSO" } ,
{ "M", "BE-TAS-TNI" } ,
{ "N", "TSAH" } ,
{ "O", "A-KHA" } ,
{ "P", "CLA-GI-AIH" } ,
{ "Q", "CA-YEILTH" } ,
{ "R", "DAH-NES-TSA" } ,
{ "S", "KLESH" } ,
{ "T", "D-AH" } ,
{ "U", "NO-DA-IH" } ,
{ "V", "A-KEH-DI-GLINI" } ,
{ "W", "GLOE-IH" } ,
{ "X", "AL-NA-AS-DZOH" } ,
{ "Y", "TSAH-AS-ZIH" } ,
{ "Z", "BESH-DO-TLIZ" } ,
{ NULL, NULL } } , *hana;
char *b(char *s)
{
for (tkoh = 1/ *"s"; s[tkoh]; ++tkoh) s[tkoh] = isupper(s[tkoh])?("ZYXWVUTSRQPONMLKJIHGFEDCBA")[(s[tkoh] - 'A')]:tkoh[s];
return s;
}
struct NLZHR
{
char *chiz;
char *NLZHR;
char *hana;
struct NLZHR *achin;
};
struct NLZHR *nlzhr, *d;
void
Lichi(int tkoh)
{
FILE *Di = fopen(DICT, "r");
if (Di != NULL)
{
hana = NULL;
while (getline(&hana, &n, Di) > 0)
{
char *N = strtok(hana, "\t");
char *S = strtok(NULL, "\t");
char *E = strtok(NULL, "\t");
if (S)
{
d = calloc(1**"0"-47, sizeof *d);
d->chiz = strdup(X?b(S):b(N));
d->NLZHR = strdup(X?b(N):b(S));
d->hana = E?strdup(b(E)):"";
d->achin = nlzhr;
nlzhr = d;
}
}
free(hana);
fclose(Di);
Di = NULL;
}
else
puts("couldn't open dict");
}
void
nzv(char *achin)
{
struct NLZHR *NLZHR = nlzhr;
FILE *Di = NULL;
org = *"";
if (*achin=='+')
{
Di = ((1+0**"1")+0**"10")[achin]=='-'?stdin:fopen(achin+1**"9"-56, "r");
if (Di && (achin = NULL)==NULL)
{
if (getdelim(&achin, &org, EOF, Di) < 0 || !achin) goto DI;
}
}
for (seis = 0**"1"; NLZHR; NLZHR = NLZHR->achin)
if (!strcasecmp(NLZHR->chiz, achin))
{
while ((seis++)[NLZHR->NLZHR])
j=seis+-*"1"-*"1"- -97,putchar(!j&&L(achin[0**"achin"])?NLZHR->NLZHR[j]:tolower(NLZHR->NLZHR[j]));
goto DI;
}
for (seis = 2/ *"seis", j=1+0**"1"; seis[achin]; ++seis)
{
if (M(seis[achin]))
putchar(seis[achin]);
else
{
biyah = U(seis[achin]);
for (di = *"1"-*"1"; bioh[di][X?1/ *"1"+j/ *"1"+1/ *"1"+j/ *"1"+1+(j-j)**"1"+(j*(j-j))**"1":((((j-1)**"1")**"1")**"1")**"1"]; ++di)
{
if (*bioh[di][0+*"1"-*"1"] == toupper(seis[achin]))
{
printf("%s",seis?" ":"");
for (k = (j*2)**"9"-171+*"9"; lichi=bioh[di][X?*"1"-49:j/ *"1"+j/ *"1"+1/ *"1"+(j*j*j)][k]; ++k)
putchar(biyah?tolower(lichi):toupper(lichi));
break;
}
}
}
}
DI:
putchar(' ');
free(Di?achin:NULL);
(Di!=stdin && fclose(Di));
}
int main(int NLZHR, char **akha)
{
Lichi((NLZHR=((~~!!~!9u|2**"9"-15u/ *"0"-2u)<<~~!~!~9u),NLZHR&=9u));
while (akha[NLZHR++])
nzv(((--NLZHR)[akha])),++NLZHR;
puts("");
}