Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!pt.cs.cmu.edu!rochester!rit!tropix!moscom!ur-valhalla!uhura.cc.rochester.edu!sunybcs!rutgers!cs.utexas.edu!uunet!iconsys!ohs!mday From: mday@ohs.UUCP (Matthew T. Day) Newsgroups: comp.sources.games.bugs Subject: Patch #1 for Greed, please apply Keywords: greed, patch, bugfix Message-ID: <313@ohs.UUCP> Date: 22 Jul 89 15:32:25 GMT Lines: 160 Here's patch #1 to Greed v1.1a, making it Greed v1.1b. Thanks to Kriton Kyrimis (kyrimis@princeton.princeton.edu) for pointing out a couple of problems and mailing me a patch to Greed that he wrote. If other people who find problems with Greed would like to point them out to me, please follow Kriton's idea of simply mailing them to me, that way I can keep the source standard through the version number. I will always fix any problem mailed to me and post it as soon as possible. This patch fixes two problems: 1) The messages that appear on the bottom line never "disappear", now they are removed after you make your next move. 2) The help window creates problems with certain systems by not redrawing the grid screen properly after it goes away, now, of course, it does. I also made some slight cosmetic changes to where messages go and how they go there, plus I made slight changes to Kriton's original patch, so Kriton, you will also want to apply this patch to your originals. To apply the following patch, simply save it under a name, and type: patch < name_you_saved_it_under If you don't have Larry Wall's "patch" program, either get it, manually apply this patch, or forget the whole thing. *** dist/greed.c Sat Jun 17 08:48:47 1989 --- greed.c Sat Jun 17 09:06:23 1989 *************** *** 1,4 **** ! /* greed.c v1.1a - Written by Matthew T. Day (mday@ohs.uucp), 06/12/89 */ #include #include --- 1,4 ---- ! /* greed.c v1.1b - Written by Matthew T. Day (mday@ohs.uucp), 06/17/89 */ #include #include *************** *** 77,90 **** (void) wmove(gridwin, y, x); waddstr(botwin, "Score: "); ! mvwaddstr(botwin, 0, 40, "Greed v1.1a - Hit '?' for help."); showscore(); while ((val = tunnel(wgetch(gridwin))) > 0); if (!val) { ! mvwaddstr(botwin, 0, 20, "Hit "); ! wrefresh(botwin); while (wgetch(botwin) != '\n'); } (void) wclear(botwin); --- 77,89 ---- (void) wmove(gridwin, y, x); waddstr(botwin, "Score: "); ! mvwaddstr(botwin, 0, 40, "Greed v1.1b - Hit '?' for help."); showscore(); while ((val = tunnel(wgetch(gridwin))) > 0); if (!val) { ! botmsg("Hit "); while (wgetch(botwin) != '\n'); } (void) wclear(botwin); *************** *** 103,108 **** --- 102,108 ---- register cmd; { register dy, dx, distance; + static int havebotmsg = 0; switch (cmd) { case 'h': case '4': *************** *** 131,136 **** --- 131,137 ---- break; case 'q': botmsg("Really quit? "); + havebotmsg = 1; if (wgetch(botwin) == 'y') return(-1); wrefresh(gridwin); return(1); *************** *** 167,177 **** --- 168,185 ---- } else { botmsg("Bad move."); wrefresh(gridwin); + havebotmsg = 1; return(1); } } while (--d); } + if (havebotmsg) { + botmsg(""); + wrefresh(gridwin); + havebotmsg = 0; + } + do { y += dy; x += dx; *************** *** 188,195 **** register char *msg; { (void) wmove(botwin, 0, 40); - wclrtoeol(botwin); waddstr(botwin, msg); wrefresh(botwin); } --- 196,203 ---- register char *msg; { (void) wmove(botwin, 0, 40); waddstr(botwin, msg); + wclrtoeol(botwin); wrefresh(botwin); } *************** *** 283,295 **** help() { WINDOW *helpwin = newwin(16, 65, 1, 7); - overlay(helpwin, gridwin); (void) wclear(helpwin); box(helpwin, '|', '-'); (void) waddch(helpwin, '+'); mvwaddch(helpwin, 0, 64, '+'); mvwaddch(helpwin, 15, 0, '+'); mvwaddch(helpwin, 15, 64, '+'); ! msg(1, "Welcome to Greed v1.1a, by Matthew T. Day (mday@ohs.uucp)."); msg(3, "The object of Greed is to erase as much of the screen as"); msg(4, "possible by moving around in a grid of numbers. To move your"); msg(5, "cursor, simply use the standard hjklyubn keys or the number"); --- 291,302 ---- help() { WINDOW *helpwin = newwin(16, 65, 1, 7); (void) wclear(helpwin); box(helpwin, '|', '-'); (void) waddch(helpwin, '+'); mvwaddch(helpwin, 0, 64, '+'); mvwaddch(helpwin, 15, 0, '+'); mvwaddch(helpwin, 15, 64, '+'); ! msg(1, "Welcome to Greed v1.1b, by Matthew T. Day (mday@ohs.uucp)."); msg(3, "The object of Greed is to erase as much of the screen as"); msg(4, "possible by moving around in a grid of numbers. To move your"); msg(5, "cursor, simply use the standard hjklyubn keys or the number"); -- +----------------------------------------------------------+-----------------+ | Matthew T. Day, Orem High School, Orem, Utah | "He who laughs, | | Internet: mday@ohs.uucp UUCP: ..!uunet!iconsys!ohs!mday | lasts." | +----------------------------------------------------------+-----------------+