From b983fab1cbb6d684019c778baec6c9091816471b Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 14 Mar 2014 23:01:06 +0000 Subject: [PATCH] Generate output the right way round! --- partition.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/partition.py b/partition.py index b539d32..4e2766d 100755 --- a/partition.py +++ b/partition.py @@ -145,10 +145,10 @@ def search_and_report(n, m): d = best[1] print "%d into %d best min fragment found: %s" % (n, m, best[0]) print " Cut up %d sticks of length %d like this:" % (n, m) - for row, count in sorted(best[2].items(), reverse=True): + for row, count in sorted(best[3].items(), reverse=True): print " %d x (%s)" % (count, " + ".join([str(Fraction(k,d)) for k in row])) print " Reassemble as %d sticks of length %d like this:" % (m, n) - for col, count in sorted(best[3].items(), reverse=True): + for col, count in sorted(best[2].items(), reverse=True): print " %d x (%s)" % (count, " + ".join([str(Fraction(k,d)) for k in col])) def main(): -- 2.30.2