From a6fa3a06d4bcf878135a2b064291bd193ca84c60 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 10 Nov 2023 08:49:52 -0800 Subject: [PATCH] Minor fix in 1994/dodsond2 alt code The original code checks for equality of number of arrows stolen before giving back the arrows. If the number is not reset after recovering arrows is set back to 0 that means that you can only recover them once. The alt code checked for >= though and now it's been changed to be equality like the original code. --- 1994/dodsond2/dodsond2.alt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1994/dodsond2/dodsond2.alt.c b/1994/dodsond2/dodsond2.alt.c index 31823b3fd..530617c6c 100644 --- a/1994/dodsond2/dodsond2.alt.c +++ b/1994/dodsond2/dodsond2.alt.c @@ -33,7 +33,7 @@ c[J(r,0)]||c[J(r,1)]||c[J(r,2)]);F(1){E"You are in room %d\n",r); K(f[r]){i++;E"You found an arrow\n");j+=20;f[r]=0;}K(b[r]==0){ E"Wumpus meat\n");j-=100;A;}K(d[r]){E"You fell in a pit\n");j-=50; A;}K(r==k){K(i){i--;l++;j-=20;E"You are missing an arrow!\n"); -}K(l>=3+(W>0?W:0)){E"You catch the robber and recover all %d arrows!\n",(W>0?W:0)+3); +}K(l==3+(W>0?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;} 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{