本文整理汇总了Python中cell.Cell.square方法的典型用法代码示例。如果您正苦于以下问题:Python Cell.square方法的具体用法?Python Cell.square怎么用?Python Cell.square使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cell.Cell
的用法示例。
在下文中一共展示了Cell.square方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: xrange
# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import square [as 别名]
for col in xrange(1, 10):
Column = []
for row in xrange(1, 10):
Column.append(Cells["R" + str(row) + "C" + str(col)])
Columns["Column" + str(col)] = Column
# Populate Squares dictionary
squarecount = 1
for RowSet in ([1, 2, 3], [4, 5, 6], [7, 8, 9]):
for ColSet in ([1, 2, 3], [4, 5, 6], [7, 8, 9]):
square = []
for row in RowSet:
for col in ColSet:
square.append(Cells["R" + str(row) + "C" + str(col)])
Cells["R" + str(row) + "C" + str(col)].square = "Square" + str(squarecount)
Squares["Square" + str(squarecount)] = square
squarecount += 1
Grid["Cells"] = Cells
Grid["Rows"] = Rows
Grid["Columns"] = Columns
Grid["Squares"] = Squares
# Import sudoku.txt file to fill our Cells dictionary
importsudoku("sudoku_extreme.txt",Cells)
# Populate potential values
updatepossibles(Grid)