当前位置: 首页>>代码示例>>Python>>正文


Python Cell.index方法代码示例

本文整理汇总了Python中cell.Cell.index方法的典型用法代码示例。如果您正苦于以下问题:Python Cell.index方法的具体用法?Python Cell.index怎么用?Python Cell.index使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cell.Cell的用法示例。


在下文中一共展示了Cell.index方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_cell

# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import index [as 别名]
 def create_cell(self, row, col, value):
     possible_values = [1,2,3,4,5,6,7,8,9]
     if value != '-':
         possible_values = 'none'
     cell = Cell(row, col, value, possible_values)
     if row <= 2 and col <= 2:
         cell.section = 0
     elif row <= 2 and col <= 5:
         cell.section = 1
     elif row <= 2 and col <= 8:
         cell.section = 2
     elif row <= 5 and col <= 2:
         cell.section = 3
     elif row <= 5 and col <= 5:
         cell.section = 4
     elif row <=5 and col <= 8:
         cell.section = 5
     elif col <= 2:
         cell.section = 6
     elif col <= 5:
         cell.section = 7
     else:
         cell.section = 8
     cell.index = str(row) + ':' + str(col)
     self.cell_list.append(cell)
开发者ID:Craiting,项目名称:sudokusolver,代码行数:27,代码来源:puzzle9x9.py

示例2: create_cell

# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import index [as 别名]
 def create_cell(self, row, col, value):
     possible_values = [1,2,3,4]
     if value != '-':
         possible_values = 'none'
     cell = Cell(row, col, value, possible_values)
     if row <= 1 and col <= 1:
         cell.section = 0
     elif row <= 1:
         cell.section = 1
     elif col <= 1:
         cell.section = 2
     else:
         cell.section = 3
     cell.index = str(row) + ':' + str(col)
     self.cell_list.append(cell)
开发者ID:Craiting,项目名称:sudokusolver,代码行数:17,代码来源:puzzle4x4.py

示例3: create_cell

# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import index [as 别名]
 def create_cell(self, row, col, value):
     possible_values = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]
     cell = Cell(row, col, value, possible_values)
     if row <= 3 and col <= 3:
         cell.section = 0
     elif row <= 3 and col <= 7:
         cell.section = 1
     elif row <= 3 and col <= 11:
         cell.section = 2
     elif row <= 3 and col <= 15:
         cell.section = 3
     elif row <= 7 and col <= 3:
         cell.section = 4
     elif row <= 7 and col <= 7:
         cell.section = 5
     elif row <= 7 and col <= 11:
         cell.section = 6
     elif row <= 7 and col <= 15:
         cell.section = 7
     elif row <= 11 and col <= 3:
         cell.section = 8
     elif row <= 11 and col <= 7:
         cell.section = 9
     elif row <= 11 and col <= 11:
         cell.section = 10
     elif row <= 11 and col <= 15:
         cell.section = 11
     elif col <= 3:
         cell.section = 12
     elif col <= 7:
         cell.section = 13
     elif col <= 11:
         cell.section = 14
     else:
         cell.section = 15
     cell.index = str(row) + ':' + str(col)
     self.cell_list.append(cell)
开发者ID:Craiting,项目名称:sudokusolver,代码行数:39,代码来源:puzzle16x16.py


注:本文中的cell.Cell.index方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。