shithub: puzzles

Download patch

ref: 8b31b4606c1e2fc927b4dc6e5c3e2df3adf1cf8b
parent: 4ba97c64fea9e12614b029296f304cb54c98b840
author: Simon Tatham <anakin@pobox.com>
date: Wed Apr 27 12:59:18 EDT 2005

Command-line solver was dividing up non-square puzzles the wrong way
round.

[originally from svn r5691]

--- a/solo.c
+++ b/solo.c
@@ -2054,7 +2054,7 @@
                 c = 'a' + c-10;
             printf("%c", c);
             if (x+1 < p->c * p->r) {
-                if ((x+1) % p->c)
+                if ((x+1) % p->r)
                     printf(" ");
                 else
                     printf(" | ");
@@ -2061,11 +2061,11 @@
             }
         }
         printf("\n");
-        if (y+1 < p->c * p->r && (y+1) % p->r == 0) {
+        if (y+1 < p->c * p->r && (y+1) % p->c == 0) {
             for (x = 0; x < p->c * p->r; x++) {
                 printf("-");
                 if (x+1 < p->c * p->r) {
-                    if ((x+1) % p->c)
+                    if ((x+1) % p->r)
                         printf("-");
                     else
                         printf("-+-");