diff --git a/1994/dodsond2/README.md b/1994/dodsond2/README.md index d41688329..1284155da 100644 --- a/1994/dodsond2/README.md +++ b/1994/dodsond2/README.md @@ -15,7 +15,6 @@ The current status of this entry is: ``` STATUS: INABIAF - please **DO NOT** fix -STATUS: known bug - please help us fix ``` For more detailed information see [1994 dodsond2 in bugs.md](/bugs.md#1994-dodsond2). diff --git a/1994/dodsond2/dodsond2.alt.c b/1994/dodsond2/dodsond2.alt.c index 68ec43cd0..e241c9250 100644 --- a/1994/dodsond2/dodsond2.alt.c +++ b/1994/dodsond2/dodsond2.alt.c @@ -15,7 +15,7 @@ #define M isdigit #define N 30 #define P getchar() -G a[N][3],b[N],c[N],d[N],e[N],f[N],g[N],i=W>0?W:0,j=0,k,l=0; +G a[N][3],b[N],c[N],d[N],e[N],f[N],g[N],i=W>0?W:0,j=0,X=0,Y=W>0?W:0,k,l=0; main(){m();n();A;}m(){G o;srandom(getpid());do{I(o=0; o0?W:0)){E"You catch the robber and recover all %d arrows!\n",(W>0?W:0)+3); -i=(W>0?W:0)+3;j+=200;k=-1;}L{E"The robber scurries away\n");do{k=D;} +}K(l&&l==Y-X){E"You catch the robber and recover all %d arrow%s!\n",Y-X,Y-X!=1?"s":""); +i=l;l=Y=X=0;j+=200;k=-1;}L{E"The robber scurries away\n");do{k=D;} F((c[k])||(d[k])||(b[k]==0)||(k==r));}}K(c[r]){c[r]=0;c[D]=1;r=D; E"The bats pick you up and drop you in room %d\n",r);j-=10;}L{ K(b[r]<3)E"You smell a wumpus\n"); @@ -45,11 +45,11 @@ K(!g[r]){j+=10;g[r]=1;}do{v=P;K(v=='s')q(r);K(v=='l')break; K(v=='i')E"You have %d arrow%c\n",i,i-1?'s':' ');K(v=='q')A;} F(!M(v));K(M(v)){n=v-'0';v=P;K(M(v))n=n*10+v-'0'; K((J(r,0)==n)||(J(r,1)==n)||(J(r,2)==n))r=n;}}}}q(r)G r;{G z,n; -char v;K(i==0){E"You have no arrows\n");H;}i--; +char v;K(i==0){E"You have no arrows\n");H;}i--;X++; E"Shoot into which rooms? ");I(z=0;z<4;z++){j-=20*z;do{v=P; K((v=='\n')&&(i>0)){j-=50;E"You have %d arrow%c\n",i,i-1?'s':' ');H;}else K(i==0)H;}F(!M(v)); n=v-'0';v=P;K(M(v))n=10*n+v-'0';K((J(r,0)==n)||(J(r,1)==n)||(J(r,2) ==n)){r=n;K(b[r]==0){E"You have killed the Wumpus!\n");j+=500+i*100; A;}}L K(random()%3==1){E"The arrow bounces back and kills you\n"); j-=100;A;}L{I(n=0;n0)){j-=50;E"You have %d arrow%c\n",i,i-1?'s':' ');H;}else K(i==0)H;}F(!M(v)); n=v-'0';v=P;K(M(v))n=10*n+v-'0';K((J(r,0)==n)||(J(r,1)==n)||(J(r,2) ==n)){r=n;K(b[r]==0){E"You have killed the Wumpus!\n");j+=500+i*100; A;}}L K(random()%3==1){E"The arrow bounces back and kills you\n"); j-=100;A;}L{I(n=0;n