This repository has been archived on 2025-08-18. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
GGS/games/tic-tac-toe/data.py
Kallfaktorn 71fa6f30ba Moved the parts of network out of server.
Partly added extensions to tic-tac-toe py.
2011-02-04 14:10:23 +01:00

15 lines
287 B
Python

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