diff options
author | June McEnroe <june@causal.agency> | 2022-01-20 23:12:16 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2022-01-20 23:12:16 -0500 |
commit | 997ab4af41b0bef3203f06962f35d3e2ecabdff1 (patch) | |
tree | ce3d6a358d80fd3e9f5a1bb1da9d17410e00e1a5 | |
parent | Add SDL2Config.cmake workarounds for MinGW compiler (diff) | |
download | wep-997ab4af41b0bef3203f06962f35d3e2ecabdff1.tar.gz wep-997ab4af41b0bef3203f06962f35d3e2ecabdff1.zip |
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.
-rw-r--r-- | freecell.c | 9 |
1 files 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) { |