Files
Cody Boone Ferguson ad622a5354 2024/ferguson1 bug fix, make goto complete (149)
A bug was discovered in prog.c (now prog.alt2.c, see below) that has
been fixed. It was not a critical bug but it came about when juggling
things during development, and fixing it means there should now only be
one place where an event might not trigger (or actually it's an event
within an event that does not trigger - polymorphism related).

The prog.c is the goto complete version - what was once prog.goto.max.c
(git status is confused however - it shows that that file is now
prog.alt2.c but actually prog.alt2.c is what prog.c was). For practical
reasons (and to make the judges not weep and curse me quite as much)
this was not the prog.c but since some others have made corrections to
their winning code I have decided to do the same thing here. It was a
hassle to juggle between the different versions and I ran out of the
number of files allowed - that is what I mean by practical reasons.

The prog.c has maintained its thematic 4666 bytes, after some formatting
updates.

Typo fixes were made in some of the supplementary C files.

Makefile updated so that one can compile prog.alt2.c.

.entry.json, index.html and obfuscation.html were all updated.

The judges' remarks were slightly corrected. It is not 134 (now 149)
jumps that occurs but rather gotos. The jumps can be over 1000, in fact
one test run was over 1400, although shorter games can be fewer (though
still a lot).

Other errors in documentation that were artefacts from earlier stages in
development were also corrected, although I'm sure there are more (the
ones that were discovered were ones near to stats that had to be
updated).
2025-08-13 08:14:05 -07:00

86 lines
4.6 KiB
C

#include<stdio.h>
#include<string.h>
#include<time.h>
#include<stdlib.h>
#include<unistd.h>
long x(long y, long z){ return rand()%(z-y+1)+y; }
unsigned m,D,Q,v,l,f,X,z,B,i,h,
r,u,d,e; long
O,R,E,G,O,N, T,R,A,I,L,
*o[]={ &O,&R,&E,&G,&O,&N} ,a,t[7],q,M, b=666,c,W;
char *y,*p; FILE*K; size_t J;
#define w(i) { V(i); V(4); goto hell; goto M; }
long Z(long x){ return x * 1663; }
#define S(x,z) while(scanf(&y[Z(x)],&z)!=1)while(getchar()!='\n');
void V(long x){ printf("%s",&y[Z(x)]); }
long k() { return E>0?x(0,99)>49:0; } int main() {
switch(1)
{ j:if(z)goto A; E*=5; B:
printf(&y[Z(12)],T); if(z) { goto f; } goto PP; default: srand(time(0));
K=fopen(DATA,"r"); if(!K||getdelim(&y,&J,EOF,K)<0)
goto hell; goto M; OO: if(b<1) { if(a){ w(40) PP: goto G; } if(f)w(41) w(45) g:goto S; } w(M>2169?47:45)
hell:
return
666; rr:;
goto OO; yy:
do{ if(b<1||M<0||M>2169){ break; F:V(51); R+=18; goto L; } goto i;
P:for(X=1; X<--(unsigned){ 7 } ; ){ goto kk; BB:*o[X]+=(X==2?t[X]*5:t[X]); goto HA; TA:++X; goto at; ZZ:; }
printf(&y[Z(11)],R,E,G,O,N,T,b,M); if(x(0,1))goto I; R:if(R<14)V(37); if(z) { z=0; l: { if (k()) { if (x(0,9) > 4) { V(52);
R+=23; if(!x(0,9)){ goto r; L: goto II; } c:; } else{ goto F; r: goto c; qq: { V(53); goto zz; } II:; } } else { goto qq; } zz: E-=9; M-=45; } goto C; y:V(42); S(2,r) switch(r) { M:V(1); v:memset(&t,0,sizeof t); goto
N; D:{ if (k()) { goto dd; ii:V(f=79); b -= 80; T/=4; goto jj; ee:; } else { goto oo; dd:V(a=29); T+=70; goto ee; x:V(X+--(
unsigned){ 6 } ); if(z){ S(3,
t[X])if(t[X]<0||t[X]>
666 ){ V(14); goto x; goto
heaven ; ET:L-=t[u]; goto XT; } L=T; for(u
=0; u < 6; ++u){ goto ET; XT:; }
if(L<0){ V(46); memset(&t,0,
sizeof t); goto v; } }
else{ S(3 ,*(o[X])) if(
*o[X]<0||*o[X] >
666) { V(14);
goto x; } T=1666-O-R-E-G-0-N; if(T<0){ V(46); O=R=E=G=N=0; goto v; LL:*o[X]=0; uu:++X; goto ZZ; } } goto bb; } } goto s; case 3: goto X; case 1:z=1; M-=45; goto v;
case 2:goto T; } goto y;
O:{ V(e = 19); O -= 40; R+=40; } goto E; i:if(O<1){ goto d; } else { v=0; } goto P; go: V(81); R+=9; N+=3; goto to;
} else{ goto y; HA:T-=X[t]; goto TA; A:for(X=1; X < 6; ){ goto BB; kk:if (*o[X]<0) goto LL; goto uu; QQ:V(B=38); goto JJ; at:; } goto B;
} T:l=1; if (E<9){ goto h; } else { goto l; h: V(16); } C: l=0; f:z=0;
X:if(R<1){ goto e; U: w(24) K:R-=R
>23?23:R>18? 18 : R > 13 ? 13 :
R; goto Y; TT:V(v=15); O=0; goto P; } else { goto K; } goto tt; Y:switch(q=x(0,22))
{ case 1:V(95); R+=5; break; case 18:V(26); goto Z; case 13:V(28); break;
case 2:O-=40; V(71); break; case 3:V(a=76); b-=70; goto W; case 4:V(77); N-=7; M-=7; break; case 5:case
10:if(q<6) { goto ha; m: V(56); goto D; o:; } else
{ goto m; oo:V(f=62); M-=50; b-=35; s:; } goto Z; a:goto H;
case 9:case 19:V(30); goto Z; case 20:V(32); break; case 21 :V(31); break; case 6:goto g; case 16: case 22:V(49); goto Z; case 17:V(72); goto Z;
case 7:V(83); M-=10; goto Z; case 8:V(86); R-=30; G-=20; O-=40; V
:switch(x(1,9)){ case 2:if(q>9){ switch(x(1,2)){ q:R+=40; goto Y; case 1:{ switch (x(2,5)) { case 2:V(a=54); goto
MM; b:w(48)
case 3:goto J; N:goto Q; case 4:i=17; } } case 2: V(5); } goto k; u: if(M<1951||W){ goto
W; } W=1;
if(!d&&!x(0,4)){ V(75); d=1; R+= 50; }
if(!x(0,3)){ w(x(0,4)?84:x(0,4)?33:34) e:if(O>39){ V(e=x(0,1)?18:19); O -= 40; goto q; d:{ if(!v)goto TT; goto P; } } goto U; } if (x(0,9) < 5) w:V(35); c=1; M-=101; ++E; k: M-=10; W: if(x(0,1)){ if (d) V(39); if(e)V(25); } while(i)heaven:{ w(i) } if (!B&&(f||
a)){ if(d&&a) V(91); if(T<666){ goto QQ; KK:Q=a?1:Q; h=f?1:h; f=a=0; V(93); T-=666; } else{ goto KK; } JJ:; } b-=f?15
:h?5:0; b-=a?5:Q?15:0; M+=170; M+=O> 99 ? 30:- 99;
b-=10; goto z; J: V(a=54); } goto k; MM
:goto k; default: if(q>10) { goto k; } if(q>7) { if(N<5) { w(99) goto M; G:goto yy; } V(13); N-=5; } goto Z; _:goto rr; S:if (E>1999){ w(27) I:goto a; } V(82); M-=9; N-=5; R-=20; goto Z;
} M-=17; goto Z; case 14: V(74); break; case 15: V(x(0,1)?69:68);
goto Z; ha:V(78); if(k()){ goto go; to:; } else { goto ii; jj:; } goto o; case 11: goto V; case
12:V(94); M-=5; b-=19; N -= 5; goto Z; tt: goto Y; case 0:V(20); Z:; } if(O>39&&!x(0,9))goto O; E: if(M<951) goto W; if (G < 36) goto b; if (x(0,9) > 2) goto n; V(96); if (x(0,1)) { goto p; Q: for (X=
1; X < 6; ++X) { goto x; bb:; } goto j; } V(97); M-= 60; goto n; H: goto R; p: if (x(0,9)<3) goto t; V(21); M -=99;
goto n; t: V(22); M -= 85; n:if(m){ goto u; } m=1; if (x(0,9) > 5) goto w; V(23); z:; } while (A++<21); goto _;
}
}