Made arrows the only input for ncurses because I never test the rest

This commit is contained in:
AnnaSnoeijs 2025-06-14 20:35:22 +02:00
parent 216afa6e77
commit b50a6f3486
2 changed files with 0 additions and 29 deletions

View file

@ -5,5 +5,3 @@
#define BOARD_HEIGHT 6
#define FIRST_NUMBER 1
#define ARROWS

View file

@ -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){