shithub: puzzles

Download patch

ref: d3290195da55beae04d1bb86f811b6f8dd6b0663
parent: ba944f9f95238d0b820e63d9b6c2d83efc09b8a2
author: Ben Harris <bjh21@bjh21.me.uk>
date: Sun Jan 8 07:34:57 EST 2023

Untangle: forbid descriptions that connect a node to itself

These cause an assertion failure in new_game(), so they should be
rejected by validate_desc().

--- a/untangle.c
+++ b/untangle.c
@@ -755,6 +755,8 @@
 		return "Expected ',' after number in game description";
 	    desc++;		       /* eat comma */
 	}
+        if (a == b)
+            return "Node linked to itself in game description";
     }
 
     return NULL;