I hate neale.

This commit is contained in:
Paul S. Ferrell 2009-10-08 11:15:06 -06:00
parent a1faaed722
commit 4f44d0bbb6
3 changed files with 9 additions and 8 deletions

View File

@ -48,7 +48,7 @@ def displacePoly(points, disp, limits, coordSequence=False):
maxX, maxY = limits maxX, maxY = limits
basePoints = [] basePoints = []
for point in points: for point in points:
x,y = point[0] + disp[0], point[1] + disp[1] x,y = int(point[0] + disp[0]), int(point[1] + disp[1])
# Check if duplication is needed on each axis # Check if duplication is needed on each axis
if x > maxX: if x > maxX:

View File

@ -203,16 +203,16 @@ class Pflanzarr:
html = ['<html>', html = ['<html>',
'<head><title>Game %d results</title>', '<head><title>Game %d results</title>',
'<link href="../ctf.css" rel="stylesheet" type="text/css">', '<link href="/ctf.css" rel="stylesheet" type="text/css">',
'</head>', '</head>',
'<body>', '<body>',
'<table><tr><th>Team<th>Kills<th>Cause of Death'] '<table><tr><th>Team<th>Kills<th>Cause of Death']
for tank in tanks: for tank in tanks:
if tank is winner: if tank is winner:
rowStyle = 'style="font-weight:bold; '\ rowStyle = 'style="font-weight:bold; '\
'background-color:%s"' % tank._color 'background-color:%s"' % tank.color
else: else:
rowStyle = 'style="background-color:%s"' % tank._color rowStyle = 'style="background-color:%s"' % tank.color
if name: if name:
name = xml.sax.saxutils.escape(tank.name) name = xml.sax.saxutils.escape(tank.name)
else: else:

View File

@ -1,10 +1,11 @@
#! /usr/bin/python #! /usr/bin/python
import asynchat
import asyncore
import optparse import optparse
import shutil import shutil
import socket
import time import time
import asyncore
import asynchat
from tanks import Pflanzarr from tanks import Pflanzarr
T = 60*5 T = 60*5
@ -41,7 +42,7 @@ class Flagger(asynchat.async_chat):
self.flag = team self.flag = team
def run_tanks(): def run_tanks(args, turns):
p = Pflanzarr.Pflanzarr(args[0], args[1]) p = Pflanzarr.Pflanzarr(args[0], args[1])
p.run(turns) p.run(turns)
@ -84,7 +85,7 @@ def main():
asyncore.loop(60, count=1) asyncore.loop(60, count=1)
now = time.time() now = time.time()
if now - lastrun >= 60: if now - lastrun >= 60:
run_tanks() run_tanks(args, turns)
lastrun = now lastrun = now
if __name__ == '__main__': if __name__ == '__main__':