From 50ef808124761ac687cbaf7cf2e6b70b97b1f6e0 Mon Sep 17 00:00:00 2001 From: Christophe Meneboeuf Date: Thu, 15 Sep 2016 23:58:58 +0200 Subject: [PATCH] Little help line --- gol_apple2.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/gol_apple2.c b/gol_apple2.c index 80b360a..1d0db5a 100755 --- a/gol_apple2.c +++ b/gol_apple2.c @@ -139,12 +139,16 @@ void editor( void ) #define KEY_UP 'i' #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; - uint8_t y = NB_LINES >> 1u; + x = NB_COLUMNS >> 1u; + y = NB_LINES >> 1u; gotoxy(x,y); + quit = 0; while ( quit == 0) { cursor(1); @@ -165,7 +169,7 @@ void editor( void ) case ' ': x = toggle_cell( x, y ); break; - case 'q': + case 'd': quit = 1; break; } @@ -201,13 +205,13 @@ void run( void ) cursor(0); gotoxy( 0u, NB_LINES ); - printf("Iteration: 1"); + printf("Iteration:1 (R)eset (E)ditor (Q)uit"); while( KeyPressed == NO_KEY) { /* Evolving the cells */ update(); /* Printing iterations */ - gotoxy(11u, NB_LINES); + gotoxy(10u, NB_LINES); printf( itoa(nb_iterations++, str_nb_iteration, 10) ); /* Testing key pressed */ if( kbhit() ){