Made arrows the only input for ncurses because I never test the rest
This commit is contained in:
parent
216afa6e77
commit
b50a6f3486
2 changed files with 0 additions and 29 deletions
27
ui_ncurses.c
27
ui_ncurses.c
|
|
@ -211,7 +211,6 @@ columnsint_t askColumn(
|
|||
const board_t board
|
||||
){
|
||||
columnsint_t column = 0;
|
||||
#ifdef ARROWS
|
||||
move( BOARD_Y, BOARD_X );
|
||||
if( board.player ) addstr( "p1" );
|
||||
else addstr( "p0" );
|
||||
|
|
@ -245,32 +244,6 @@ columnsint_t askColumn(
|
|||
break;
|
||||
}
|
||||
}
|
||||
#else /* !ARROWS */
|
||||
for(;;){
|
||||
mvaddstr(
|
||||
INPUT_Y,
|
||||
INPUT_X,
|
||||
"Where does player "
|
||||
);
|
||||
if( board.player ) addstr( "1" );
|
||||
else addstr( "0" );
|
||||
addstr( " put the piece? " );
|
||||
clrtoeol();
|
||||
refresh();
|
||||
scanw( " %d", &column );
|
||||
column -= FIRST_NUMBER;
|
||||
move(
|
||||
INPUT_Y + 1,
|
||||
INPUT_X
|
||||
);
|
||||
clrtoeol();
|
||||
if( column >= 0 && column < board.columns )
|
||||
if( board.height [ column ] < board.columns )
|
||||
return column;
|
||||
else addstr( "Pls enter a column that ain't full" );
|
||||
else addstr( "Pls enter a column that exists" );
|
||||
}
|
||||
#endif /* ! ARROWS */
|
||||
}
|
||||
|
||||
void exit_ui(void){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue