summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--bin/freecell.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/bin/freecell.c b/bin/freecell.c
index 762b5552..6fce1db7 100644
--- a/bin/freecell.c
+++ b/bin/freecell.c
@@ -173,10 +173,9 @@ static void moveSingle(uint dst, uint src) {
 	enq(dst, src);
 }
 
-static uint freeCells(uint cells[static Stacks], uint dst) {
+static uint freeCells(uint cells[static 4]) {
 	uint len = 0;
-	for (uint i = Cell; i < Stacks; ++i) {
-		if (i == dst) continue;
+	for (uint i = Cell; i < Tableau; ++i) {
 		if (!stacks[i].len) cells[len++] = i;
 	}
 	return len;
@@ -195,8 +194,8 @@ static uint moveDepth(uint src) {
 
 static void moveColumn(uint dst, uint src) {
 	uint depth;
-	uint cells[Stacks];
-	uint free = freeCells(cells, dst);
+	uint cells[4];
+	uint free = freeCells(cells);
 	for (depth = moveDepth(src); depth; --depth) {
 		if (free < depth-1) continue;
 		if (valid(dst, stacks[src].cards[stacks[src].len-depth])) break;
bad563447d17585168e06c&follow=1'>Use curl error bufferJune McEnroe 2019-09-10Set Accept-Encoding in titleJune McEnroe Because apparently it's fine for servers to respond with Content-Encoding you didn't ask for, and curl won't decode it if you didn't ask for it. 2019-09-08Set title User-AgentJune McEnroe Some things don't like you if you don't send one. 2019-09-07Add -x flag to titleJune McEnroe 2019-09-07Ignore SIGPIPE in relayJune McEnroe Allows restarting consumers safely. 2019-09-07Add A Memory Called EmpireJune McEnroe 2019-09-05Handle lack of Content-TypeJune McEnroe 2019-09-05Use CURLINFO_CONTENT_TYPEJune McEnroe Oops, didn't see this. 2019-09-05Decode entities in titlesJune McEnroe 2019-09-05Print title as soon as it's availableJune McEnroe 2019-09-05Use CURL_PREFIX to set flagsJune McEnroe 2019-09-05Add titleJune McEnroe 2019-09-04Add Avorter n'est pas tuerJune McEnroe 2019-08-29Unset executable on shell scriptsJune McEnroe 2019-08-29Add long-missing setopt to bin.7June McEnroe 2019-08-29Add editJune McEnroe