本文整理汇总了Python中sudoku.Sudoku.validate方法的典型用法代码示例。如果您正苦于以下问题:Python Sudoku.validate方法的具体用法?Python Sudoku.validate怎么用?Python Sudoku.validate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sudoku.Sudoku
的用法示例。
在下文中一共展示了Sudoku.validate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MainWindow
# 需要导入模块: from sudoku import Sudoku [as 别名]
# 或者: from sudoku.Sudoku import validate [as 别名]
#.........这里部分代码省略.........
'''TODO change color to indicate that it's precalculated'''
def setCellValueFromView(self, value):
c = self.sender()
self.cellValueChanged.emit( self.board.index(c), value )
def onActionSalirTriggered(self):
self.close()
def setHomeWindow(self, homeWindow):
"""Metodo que obtiene una referencia de la ventana home.
:param self: Referencia a la clase.
:param value: Referencia a la ventana home"""
self.homeWindow = homeWindow
def setDifficulty(self,value):
"""Se agrega la dificultad a la clase."""
self.difficulty = value
def onActionJuegoNuevoTriggered(self):
name = self.ui.btnJugador.text()
self.newGame(name)
def onActionAtrasTriggered(self):
self.hide()
self.homeWindow.show()
def on_endGameButton_triggered(self):
msj = QMessageBox()
valid = self.sudoku.validate()
msj.setText( "Valido" if valid else "No valido" )
msj.exec_()
if valid:
self.endGame()
def on_actionGUARDAR_triggered(self):
userName = str(self.ui.btnJugador.text())
seconds = int(self.s) + int(self.m) * 60 + int(self.h) * 60 * 60
games = Game.loadFromFile()
games.append( Game(userName, seconds, self.sudoku) )
Game.saveToFile(games)
def on_actionCARGAR_triggered(self):
self.loadGamesWindow.loadData()
self.loadGamesWindow.show()
# Signals
cellValueChanged = pyqtSignal(int, int)
def __init__(self):
QMainWindow.__init__(self)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.initBoard()
self.ui.actionJUEGO_NUEVO.triggered.connect(self.onActionJuegoNuevoTriggered)
self.ui.actionSALIR.triggered.connect(self.onActionSalirTriggered)
self.ui.actionATRAS.triggered.connect(self.onActionAtrasTriggered)