Moved the parts of network out of server.
Partly added extensions to tic-tac-toe py.
This commit is contained in:
parent
f59d59814a
commit
71fa6f30ba
10 changed files with 237 additions and 74 deletions
15
games/tic-tac-toe/data.py
Normal file
15
games/tic-tac-toe/data.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
def greatest_sequence(match, pattern):
|
||||
m = match
|
||||
p = pattern
|
||||
size = 0
|
||||
max_size = 0
|
||||
|
||||
for p in pattern:
|
||||
if m == p:
|
||||
size += 1
|
||||
else:
|
||||
if size > max_size:
|
||||
max_size = size
|
||||
size = 0
|
||||
|
||||
return max_size
|
||||
Reference in a new issue