From ac1312be2d4357e77244137ce0f349b1665ecb62 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Thu, 29 Feb 2024 01:50:44 +0100 Subject: Added exit without saving command. --- tsalis/README.md | 1 + tsalis/src/handler.c | 5 +++++ tsalis/src/tsalis.c | 1 - 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tsalis/README.md b/tsalis/README.md index 3f9b6ad..ce27647 100644 --- a/tsalis/README.md +++ b/tsalis/README.md @@ -51,6 +51,7 @@ control some aspects of the simulation. Parameters here are represented by |Command |Param. 1 |Param. 2 |Action | |:-----------|:-----------|:-----------|---------------------------------------------------------------------:| |q |--- |--- |Save and quit simulation. | +|x |--- |--- |Quit simulation without saving. | |i*XX*\_*XX* |address |instructions|Writes given instructions into address. | |c*XX*\_*XX* |address |file name |Compiles given file into address. | |n*XX*\_*XX* |address |size |Initializes organism of given size into address. | diff --git a/tsalis/src/handler.c b/tsalis/src/handler.c index ded2d9a..265df47 100644 --- a/tsalis/src/handler.c +++ b/tsalis/src/handler.c @@ -163,6 +163,11 @@ runConsole(void) switch (command[0]) { case 'q': + s_save(g_simName); + g_exit = STRUE; + break; + + case 'x': g_exit = STRUE; break; diff --git a/tsalis/src/tsalis.c b/tsalis/src/tsalis.c index 6840a02..f578e8f 100644 --- a/tsalis/src/tsalis.c +++ b/tsalis/src/tsalis.c @@ -106,7 +106,6 @@ static void quit(void) { tsp_quit(); - s_save(g_simName); s_quit(); } -- cgit v1.2.1