Path: utzoo!attcan!uunet!mitel!sce!cognos!sysint!john From: john@sysint.UUCP (John Abbott) Newsgroups: comp.sources.games.bugs Subject: Wanderer2 - movement counter enhancements Keywords: wanderer, move, enhancement Message-ID: <154@sysint.UUCP> Date: 9 Nov 88 14:32:45 GMT Reply-To: john@sysint.UUCP (John Abbott) Followup-To: comp.sources.games.bugs Organization: Systems Interface Inc, Ottawa, Ontario, Canada Lines: 83 The following enhancement changes the way in which wanderer counts the # of moves which the user has made. In particular, only moves which result in some movement are counted; Invalid input is not counted as a move any longer. Apply the following patches using Larry Wall's patch program: *** /tmp/,RCSt1a12150 Fri Nov 4 14:39:44 1988 --- game.c Fri Nov 4 10:30:06 1988 *************** *** 132,138 int x,y,nx,ny,deadyet =0, sx = -1,sy = -1,tx = -1,ty = -1,lx = 0,ly = 0,mx = -1,my = -1, bx, by, nbx, nby, ! newnum, max_score = 250, diamonds = 0, nf = 0,hd ,vd ,xdirection,ydirection; char (*frow)[ROWLEN+1] = screen, --- 132,138 ----- int x,y,nx,ny,deadyet =0, sx = -1,sy = -1,tx = -1,ty = -1,lx = 0,ly = 0,mx = -1,my = -1, bx, by, nbx, nby, ! newnum, moved, max_score = 250, diamonds = 0, nf = 0,hd ,vd ,xdirection,ydirection; char (*frow)[ROWLEN+1] = screen, *************** *** 257,262 ny++; if(ch == keys[0]) ny--; if(ch == '1') /* Add or get rid of that awful sound */ { move(10,45); --- 257,263 ----- ny++; if(ch == keys[0]) ny--; + moved = (nx != x) || (ny != y); /* remember if we have moved */ if(ch == '1') /* Add or get rid of that awful sound */ { move(10,45); *************** *** 621,626 refresh(); break; default: break; } if((y == ny) && (x == nx) && (maxmoves>0)) --- 622,628 ----- refresh(); break; default: + moved = 0; /* we didn't move! */ break; } if(moved && (maxmoves>0)) *************** *** 623,629 default: break; } ! if((y == ny) && (x == nx) && (maxmoves>0)) { (void) sprintf(buffer,"Moves remaining = %d ",--maxmoves); move(15,48); --- 625,631 ----- moved = 0; /* we didn't move! */ break; } ! if(moved && (maxmoves>0)) { (void) sprintf(buffer,"Moves remaining = %d ",--maxmoves); move(15,48); -- /\ John Abbott Systems Interface Inc. / \ VOICE: (613) 230-4103 560 Rochester St, 2nd Floor /----\ FAX: (613) 230-6928 Ottawa, Ontario, CANADA K1S 5K2 \__/ \ UUCP: uunet!mnetor!dciem!nrcaer!cognos!sysint!john