From 997ab4af41b0bef3203f06962f35d3e2ecabdff1 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Thu, 20 Jan 2022 23:12:16 -0500 Subject: Only use cells for moveColumn So long as the move queuer doesn't use empty tableau stacks correctly, it shouldn't use them at all. This way it's easier to do the correct moves manually. --- freecell.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/freecell.c b/freecell.c index 06276d3..16b13f8 100644 --- a/freecell.c +++ b/freecell.c @@ -188,18 +188,17 @@ static uint moveDepth(uint src) { return n; } -static uint freeCells(uint cells[], uint dst) { +static uint freeCells(uint cells[]) { uint len = 0; - for (uint i = Cell1; i <= Tableau8; ++i) { - if (i == dst) continue; + for (uint i = Cell1; i <= Cell4; ++i) { if (!stacks[i].len) cells[len++] = i; } return len; } static void moveColumn(uint dst, uint src) { - uint cells[StacksLen]; - uint free = freeCells(cells, dst); + uint cells[4]; + uint free = freeCells(cells); uint depth; for (depth = moveDepth(src); depth; --depth) { -- cgit 1.4.1