mirror of
https://github.com/Pixinn/gameoflife-appleii.git
synced 2024-06-13 17:29:26 +00:00
Little help line
This commit is contained in:
parent
add17d0257
commit
50ef808124
16
gol_apple2.c
16
gol_apple2.c
|
@ -139,12 +139,16 @@ void editor( void )
|
||||||
#define KEY_UP 'i'
|
#define KEY_UP 'i'
|
||||||
#define KEY_RIGHT 'l'
|
#define KEY_RIGHT 'l'
|
||||||
|
|
||||||
uint8_t quit = 0;
|
uint8_t quit, x, y;
|
||||||
|
|
||||||
|
gotoxy( 0u, NB_LINES );
|
||||||
|
printf("EDITOR (D)one");
|
||||||
|
|
||||||
uint8_t x = NB_COLUMNS >> 1u;
|
x = NB_COLUMNS >> 1u;
|
||||||
uint8_t y = NB_LINES >> 1u;
|
y = NB_LINES >> 1u;
|
||||||
gotoxy(x,y);
|
gotoxy(x,y);
|
||||||
|
|
||||||
|
quit = 0;
|
||||||
while ( quit == 0)
|
while ( quit == 0)
|
||||||
{
|
{
|
||||||
cursor(1);
|
cursor(1);
|
||||||
|
@ -165,7 +169,7 @@ void editor( void )
|
||||||
case ' ':
|
case ' ':
|
||||||
x = toggle_cell( x, y );
|
x = toggle_cell( x, y );
|
||||||
break;
|
break;
|
||||||
case 'q':
|
case 'd':
|
||||||
quit = 1;
|
quit = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -201,13 +205,13 @@ void run( void )
|
||||||
cursor(0);
|
cursor(0);
|
||||||
|
|
||||||
gotoxy( 0u, NB_LINES );
|
gotoxy( 0u, NB_LINES );
|
||||||
printf("Iteration: 1");
|
printf("Iteration:1 (R)eset (E)ditor (Q)uit");
|
||||||
while( KeyPressed == NO_KEY)
|
while( KeyPressed == NO_KEY)
|
||||||
{
|
{
|
||||||
/* Evolving the cells */
|
/* Evolving the cells */
|
||||||
update();
|
update();
|
||||||
/* Printing iterations */
|
/* Printing iterations */
|
||||||
gotoxy(11u, NB_LINES);
|
gotoxy(10u, NB_LINES);
|
||||||
printf( itoa(nb_iterations++, str_nb_iteration, 10) );
|
printf( itoa(nb_iterations++, str_nb_iteration, 10) );
|
||||||
/* Testing key pressed */
|
/* Testing key pressed */
|
||||||
if( kbhit() ){
|
if( kbhit() ){
|
||||||
|
|
Loading…
Reference in New Issue
Block a user