mirror of
https://github.com/gwenhael-le-moine/c-urs_-toil-s.git
synced 2024-12-27 09:58:44 +01:00
flexible count of levels
This commit is contained in:
parent
524e4d223d
commit
10f64607e8
1 changed files with 4 additions and 1 deletions
5
star.c
5
star.c
|
@ -422,6 +422,9 @@ int main( int argc, char* argv[] )
|
||||||
int i = 0, lvl = 0, key;
|
int i = 0, lvl = 0, key;
|
||||||
struct state *s = malloc( sizeof( struct state ) );
|
struct state *s = malloc( sizeof( struct state ) );
|
||||||
|
|
||||||
|
/* trick to count how many levels we have */
|
||||||
|
int nb_levels = sizeof( levels ) / sizeof( levels[ 0 ] );
|
||||||
|
|
||||||
/* ncurses */
|
/* ncurses */
|
||||||
WINDOW *w_main = initscr( );
|
WINDOW *w_main = initscr( );
|
||||||
cbreak();
|
cbreak();
|
||||||
|
@ -459,7 +462,7 @@ int main( int argc, char* argv[] )
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while( lvl < 25 && (( key != 'q' ) && ( key != 'Q' )) );
|
} while( lvl < nb_levels && (( key != 'q' ) && ( key != 'Q' )) );
|
||||||
display_level( s );
|
display_level( s );
|
||||||
|
|
||||||
free( s );
|
free( s );
|
||||||
|
|
Loading…
Reference in a new issue