X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fknight.c;h=727d57fb7a47335652ae8744cdde7133d448b509;hp=af0ca8ab945052b0ae516fbd5d7783ace8ef1149;hb=71c0306f0824ef2b10c4c5813fb003db48f3012e;hpb=027ae42953e3186daed8f3882da73de48291b606 diff --git a/test/knight.c b/test/knight.c index af0ca8ab..727d57fb 100644 --- a/test/knight.c +++ b/test/knight.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2002,2006 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -33,7 +33,7 @@ * Eric S. Raymond July 22 1995. Mouse support * added September 20th 1995. * - * $Id: knight.c,v 1.27 2006/04/22 22:41:22 tom Exp $ + * $Id: knight.c,v 1.29 2010/05/01 19:11:55 tom Exp $ */ #include @@ -155,7 +155,7 @@ help1(void) (void) waddstr(helpwin, "puzzle; also inform you when you run out\n"); (void) waddstr(helpwin, "of legal moves.\n\n"); - (void) mvwaddstr(helpwin, NOTIFYY - INSTRY, 0, + MvWAddStr(helpwin, NOTIFYY - INSTRY, 0, "Press `?' to go to keystroke help."); } @@ -181,7 +181,7 @@ help2(void) (void) waddstr(helpwin, "square with spacebar, Enter, or the keypad\n"); (void) waddstr(helpwin, "center key. Use F/B to review the path.\n"); - (void) mvwaddstr(helpwin, NOTIFYY - INSTRY, 0, + MvWAddStr(helpwin, NOTIFYY - INSTRY, 0, "Press `?' to go to game explanation"); } @@ -226,7 +226,7 @@ dosquares(void) { int i, j; - mvaddstr(0, 20, "KNIGHT'S MOVE -- a logical solitaire"); + MvAddStr(0, 20, "KNIGHT'S MOVE -- a logical solitaire"); move(BOARDY, BOARDX); waddch(boardwin, ACS_ULCORNER); @@ -383,7 +383,7 @@ drawmove(chtype tchar, int oldy, int oldx, int row, int column) mark_possibles(oldy, oldx, ' '); } - if (row != -1 && column != -1) { + if (row >= 0 && column >= 0) { markcell(trail, row, column); mark_possibles(row, column, minus); board[row][column] = TRUE;