From 82d36b296252a3331c4e3ff0914cf92f20beaf9e Mon Sep 17 00:00:00 2001 From: girst Date: Fri, 15 Nov 2019 14:32:52 +0100 Subject: [PATCH] ifdef off inverted move logic that proved to be more annoying than useful for me. pass -DINVERSE_MOVE to the compiler to reenable. --- sol.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sol.c b/sol.c index 63ada23..e4c56e1 100644 --- a/sol.c +++ b/sol.c @@ -114,13 +114,13 @@ newgame: #define is_tableu(where) (where <= TAB_MAX) /* "card games helper functions" */ int sol(void) { - int ret; long seed = time(NULL); restart: free_undo(f.u); deal(seed); int from, to, opt; + int ret; for(;;) { switch (get_cmd(&from, &to, &opt)) { case CMD_MOVE: @@ -129,11 +129,12 @@ restart: if (ret == ERR && is_tableu(from) && to == from) /* t2f failed? try t2c! */ ret = t2c(from, STOCK, 0); - else #endif +#ifdef INVERSE_MOVE if (ret == ERR && is_tableu(from) && is_tableu(to)) /* try again with from/to swapped: */ ret = action[to][from](to,from,opt); +#endif switch (ret) { case OK: break; case ERR: visbell(); break; -- 2.39.3