From b50a6f34869a1a721419c9b08e2aa668120c148a Mon Sep 17 00:00:00 2001 From: AnnaSnoeijs Date: Sat, 14 Jun 2025 20:35:22 +0200 Subject: [PATCH] Made arrows the only input for ncurses because I never test the rest --- config.h | 2 -- ui_ncurses.c | 27 --------------------------- 2 files changed, 29 deletions(-) diff --git a/config.h b/config.h index f1e8451..a134cab 100644 --- a/config.h +++ b/config.h @@ -5,5 +5,3 @@ #define BOARD_HEIGHT 6 #define FIRST_NUMBER 1 - -#define ARROWS diff --git a/ui_ncurses.c b/ui_ncurses.c index 00bf47c..cdf0e7b 100644 --- a/ui_ncurses.c +++ b/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){