Added the boardgame tic-tac-toe without winning conditions, written entirely in Python.
This commit is contained in:
parent
0590fa6ca1
commit
affcb739b4
28 changed files with 448 additions and 0 deletions
23
games/tic-tac-toe/input.py
Normal file
23
games/tic-tac-toe/input.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#Input.py
|
||||
|
||||
#Variables: Key_Id[Int,String], KeyBehaviour[enum], Action[method]
|
||||
#Methods: update() Param nothing,
|
||||
#Behaviour
|
||||
|
||||
|
||||
#in update. when called. takes the state of the key. compares with the behaviour.
|
||||
#if fullfilled perform action.
|
||||
|
||||
|
||||
#All Input instances have an id.
|
||||
class Input(object):
|
||||
id = -1
|
||||
fun = None
|
||||
def __init__(self, id, fun):
|
||||
self.id = id
|
||||
self.fun = fun
|
||||
|
||||
def notify(self):
|
||||
pass
|
||||
def update(self,state):
|
||||
pass
|
||||
Reference in a new issue