summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--freecell.c9
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) {