Commit c0314326 authored by DUFAIX Clement's avatar DUFAIX Clement
Browse files

add Game class

parent caba07be
# Default ignored files
/shelf/
/workspace.xml
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/mutorerer_ias.iml" filepath="$PROJECT_DIR$/.idea/mutorerer_ias.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
import sys
import numpy as np
import PyQt5
class Game:
boardGame = [1, 1, 1, 1, 2, 2, 2, 2,
0] # boardGame[0-7] : kewai, boardGame[8] : putahi, 1 : pion joueur 1, 2 : pion joueur 2, 0 : vide
# def __init__(self):
@staticmethod
def movePawn(positionToMove):
if not Game.isMoveLegit(positionToMove):
return False
return True
@staticmethod
def isMoveLegit(positionToMove):
if positionToMove == 9:
if Game.boardGame[8] != 0: return False
return True
if __name__ == "__main__":
print(Game.movePawn(4))
print(8%8)
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment