# HG changeset patch # User Henry Thompson # Date 1685395493 -3600 # Node ID 68004ce5570392fb574900992751428d3e1729b1 # Parent dd63412fc8825c7f8509bf97f3da661ad3dc450d convert to newer source of Nonogram data diff -r dd63412fc882 -r 68004ce55703 nono.py --- a/nono.py Mon May 29 22:03:08 2023 +0100 +++ b/nono.py Mon May 29 22:24:53 2023 +0100 @@ -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