From 715437078a1d48f99f4184af626af0cfbee42504 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Mon, 31 Mar 2025 10:23:13 +0000 Subject: [PATCH] add macros --- w/w.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/w/w.c b/w/w.c index e9bc09c..c137e81 100644 --- a/w/w.c +++ b/w/w.c @@ -10,6 +10,8 @@ #define CMD_NULL "-" #define CMD_FWD 's' +#define CMD_ATTACK 'a' +#define CMD_FLEE 'f' #define SC_TITLE 0 #define SC_SETNAME 1 @@ -470,11 +472,11 @@ void update(char command[CMD_LEN]) } else if (state.screen == SC_MONSTER) { - if (c == 'f') + if (c == CMD_FLEE) { state.screen = SC_MAP; } - else if (c == 'a') + else if (c == CMD_ATTACK) { // hero then monster turn. // possible outcomes: hero dead, monster dead, or still fight