# HG changeset patch # User Henry S. Thompson # Date 1702488758 0 # Node ID 19262b15a099060d39dad09b07f7708c75937712 # Parent bc1acb1416ab649c4a0e0c9492be4eea30f89dd9# Parent 68004ce5570392fb574900992751428d3e1729b1 merge diff -r bc1acb1416ab -r 19262b15a099 nono.py --- a/nono.py Wed Dec 13 17:31:28 2023 +0000 +++ b/nono.py Wed Dec 13 17:32:38 2023 +0000 @@ -9,6 +9,10 @@ # 13 # 1 1 # 2 9 +# New version, input taken from Nonograms Outer HTML plus +# > fgrep 'task = ' nono10.xhtml|tr ';' '\n' | fgrep task\ = | sed 's/^.*= //'| tr -d \' +# E.g. 8/5.1/2.3/2.1/4.3/3.4/2/1.1/3/5.2/2.2/2.2/1.3.2/5.1/3.1.1/2/2.3.1/7.1/1.1.2/3.2 + import sys @@ -24,8 +28,8 @@ # reads top-to-bottom or left-to-right def __init__(self,n,m,runs): list.__init__(self,list(range(n))) - self.n=n - self.m=m + self.n=n # size + self.m=m # parent NoNo self.margin0=0 # a run can start here, so if >0 then self[m0-1].val must be False self.marginN=n-1 # a run can end here, so if