Started adding parsing of command-line options
This commit is contained in:
parent
89712fc9dc
commit
bf1ae99a9a
4 changed files with 56 additions and 15 deletions
29
ui_ncurses.c
29
ui_ncurses.c
|
|
@ -132,14 +132,27 @@ void initBoard( void ){
|
|||
void updateBoard(
|
||||
const wins_t wins,
|
||||
const board_t board,
|
||||
const move_t move,
|
||||
const int column
|
||||
){
|
||||
for(int row = 0; row < board.height[ column ]; row++){
|
||||
mvaddstr(
|
||||
BOARD_Y + BOARD_DY * ( BOARD_HEIGHT - row ),
|
||||
BOARD_X + 1 + BOARD_DX * ( column + 1 ),
|
||||
board.column[ column ] & 1 << row ? "1" : "0"
|
||||
);
|
||||
int height = board.height[ column ];
|
||||
switch( move ){
|
||||
case PUT:
|
||||
mvaddstr(
|
||||
BOARD_Y + BOARD_DY * ( BOARD_HEIGHT - height - 1 ),
|
||||
BOARD_X + 1 + BOARD_DX * ( column + 1 ),
|
||||
board.column[ column ] & 1 << ( height - 1 ) ? "1" : "0"
|
||||
);
|
||||
break;
|
||||
default:
|
||||
for( int row = 0; row < height; row++ ){
|
||||
mvaddstr(
|
||||
BOARD_Y + BOARD_DY * ( BOARD_HEIGHT - row ),
|
||||
BOARD_X + 1 + BOARD_DX * ( column + 1 ),
|
||||
board.column[ column ] & 1 << row ? "1" : "0"
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
char num[4];
|
||||
sprintf( num, "%3d", wins.count0.vertical );
|
||||
|
|
@ -205,8 +218,8 @@ void updateBoard(
|
|||
}
|
||||
|
||||
int askColumn(
|
||||
const board_t board
|
||||
,const move_t move
|
||||
const board_t board,
|
||||
const move_t move
|
||||
){
|
||||
int column = 0;
|
||||
#ifdef ARROWS
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue