[Puzzler-checkins] SF.net SVN: puzzler:[645] trunk/puzzler/puzzler/puzzles/__init__.py
Brought to you by:
goodger
From: <go...@us...> - 2017-01-15 17:36:35
|
Revision: 645 http://sourceforge.net/p/puzzler/code/645 Author: goodger Date: 2017-01-15 17:36:34 +0000 (Sun, 15 Jan 2017) Log Message: ----------- Moved matrix_header_pieces & matrix_header_coords methods from Puzzle2D class to Puzzle class Modified Paths: -------------- trunk/puzzler/puzzler/puzzles/__init__.py Modified: trunk/puzzler/puzzler/puzzles/__init__.py =================================================================== --- trunk/puzzler/puzzler/puzzles/__init__.py 2016-12-06 00:35:43 UTC (rev 644) +++ trunk/puzzler/puzzler/puzzles/__init__.py 2017-01-15 17:36:34 UTC (rev 645) @@ -227,6 +227,18 @@ """ raise NotImplementedError + def matrix_header_pieces(self): + """Return an ordered list of piece names for build_matrix_header.""" + return sorted(self.pieces.keys()) + + def matrix_header_coords(self): + """ + Return an ordered list of coordinates for build_matrix_header. + + Override e.g. to ensure that secondary columns are at the end. + """ + return sorted(self.solution_coords) + def build_matrix_header(self): """ Create and populate the first row of `self.matrix`, a list of column @@ -512,18 +524,6 @@ aspects.add(aspect) return aspects - def matrix_header_pieces(self): - """Return an ordered list of piece names for build_matrix_header.""" - return sorted(self.pieces.keys()) - - def matrix_header_coords(self): - """ - Return an ordered list of coordinates for build_matrix_header. - - Override e.g. to ensure that secondary columns are at the end. - """ - return sorted(self.solution_coords) - def build_matrix_header(self): headers = [] for i, key in enumerate(self.matrix_header_pieces()): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |