aboutsummaryrefslogtreecommitdiff
path: root/competition.py
diff options
context:
space:
mode:
Diffstat (limited to 'competition.py')
-rwxr-xr-xcompetition.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/competition.py b/competition.py
index 7c48846..9d3c15a 100755
--- a/competition.py
+++ b/competition.py
@@ -18,6 +18,8 @@ Options:
import os,sys,subprocess,shlex,re,time
+MAXTIMELIMIT=None #in seconds
+
S=5
PNONE=0
PP1=1
@@ -282,14 +284,15 @@ while True:
if len(line)>0:
break
time.sleep(0.1)
+ if MAXTIMELIMIT==None: continue
timeoutfail=False
if player==1:
p1totaltime+=0.1
- if p1totaltime>=50:
+ if p1totaltime>=MAXTIMELIMIT:
timeoutfail=True
else:
p2totaltime+=0.1
- if p2totaltime>=50:
+ if p2totaltime>=MAXTIMELIMIT:
timeoutfail=True
if timeoutfail:
print("P"+str(player)+" timed out!")