diff --git a/puzzles/sequence/400/index.html b/puzzles/sequence/400/index.html index 9787d0f..f0c33ca 100644 --- a/puzzles/sequence/400/index.html +++ b/puzzles/sequence/400/index.html @@ -1,27 +1,3 @@
-00000000 61 61 9e 23 01 0c 0c 40 0d 05 40 29 13 08 0d 01 -00000010 05 0c 4e 40 40 33 0f 0d 05 40 19 05 01 12 13 40 -00000020 01 07 0f 4d 4d 0e 05 16 05 12 40 0d 09 0e 04 40 -00000030 08 0f 17 40 0c 0f 0e 07 6a 10 12 05 03 09 13 05 -00000040 0c 19 4d 4d 08 01 16 09 0e 07 40 0c 09 14 14 0c -00000050 05 40 0f 12 40 0e 0f 40 0d 0f 0e 05 19 40 09 0e -00000060 40 0d 19 40 10 15 12 13 05 4c 40 01 0e 04 40 0e -00000070 0f 14 08 09 0e 07 6a 10 01 12 14 09 03 15 0c 01 -00000080 12 40 14 aa 61 62 9d 0f 40 09 0e 14 05 12 05 13 -00000090 14 40 0d 05 40 0f 0e 40 13 08 0f 12 05 4c 40 29 -000000a0 40 14 08 0f 15 07 08 14 40 29 40 17 0f 15 0c 04 -000000b0 40 13 01 09 0c 40 01 02 0f 15 14 40 01 6a 0c 09 -000000c0 14 14 0c 05 40 01 0e 04 40 13 05 05 40 14 08 05 -000000d0 40 17 01 14 05 12 19 40 10 01 12 14 40 0f 06 40 -000000e0 14 08 05 40 17 0f 12 0c 04 4e 40 40 29 14 40 09 -000000f0 13 40 01 40 17 01 19 40 29 40 08 01 16 05 40 0f -00000100 06 6a 04 12 09 16 09 3b 61 63 9c 0e 07 40 0f 06 -00000110 06 40 14 08 05 40 13 10 0c 05 05 0e 40 01 0e 04 -00000120 40 12 05 07 15 0c 01 14 09 0e 07 40 14 08 05 40 -00000130 03 09 12 03 15 0c 01 14 09 0f 0e 4e 40 40 37 08 -00000140 05 0e 05 16 05 12 40 29 6a 06 09 0e 04 40 0d 19 -00000150 13 05 0c 06 40 07 12 0f 17 09 0e 07 40 07 12 09 -00000160 0d 40 01 02 0f 15 14 40 14 08 05 40 0d 0f 15 14 -00000170 08 5b 40 17 08 05 0e 05 16 05 12 40 09 14 40 09 -00000180 13 40 01 40 04 01 0d 10 4c 6a 04 bb __ __ __ +0000 0001 0011 0010 0110 0111 _diff --git a/puzzles/sequence/400/key b/puzzles/sequence/400/key index 7a6f1f6..7d0d318 100644 --- a/puzzles/sequence/400/key +++ b/puzzles/sequence/400/key @@ -1 +1 @@ -61 64 9b +0101 diff --git a/puzzles/sequence/600/index.html b/puzzles/sequence/600/index.html new file mode 100644 index 0000000..9787d0f --- /dev/null +++ b/puzzles/sequence/600/index.html @@ -0,0 +1,27 @@ +
+00000000 61 61 9e 23 01 0c 0c 40 0d 05 40 29 13 08 0d 01 +00000010 05 0c 4e 40 40 33 0f 0d 05 40 19 05 01 12 13 40 +00000020 01 07 0f 4d 4d 0e 05 16 05 12 40 0d 09 0e 04 40 +00000030 08 0f 17 40 0c 0f 0e 07 6a 10 12 05 03 09 13 05 +00000040 0c 19 4d 4d 08 01 16 09 0e 07 40 0c 09 14 14 0c +00000050 05 40 0f 12 40 0e 0f 40 0d 0f 0e 05 19 40 09 0e +00000060 40 0d 19 40 10 15 12 13 05 4c 40 01 0e 04 40 0e +00000070 0f 14 08 09 0e 07 6a 10 01 12 14 09 03 15 0c 01 +00000080 12 40 14 aa 61 62 9d 0f 40 09 0e 14 05 12 05 13 +00000090 14 40 0d 05 40 0f 0e 40 13 08 0f 12 05 4c 40 29 +000000a0 40 14 08 0f 15 07 08 14 40 29 40 17 0f 15 0c 04 +000000b0 40 13 01 09 0c 40 01 02 0f 15 14 40 01 6a 0c 09 +000000c0 14 14 0c 05 40 01 0e 04 40 13 05 05 40 14 08 05 +000000d0 40 17 01 14 05 12 19 40 10 01 12 14 40 0f 06 40 +000000e0 14 08 05 40 17 0f 12 0c 04 4e 40 40 29 14 40 09 +000000f0 13 40 01 40 17 01 19 40 29 40 08 01 16 05 40 0f +00000100 06 6a 04 12 09 16 09 3b 61 63 9c 0e 07 40 0f 06 +00000110 06 40 14 08 05 40 13 10 0c 05 05 0e 40 01 0e 04 +00000120 40 12 05 07 15 0c 01 14 09 0e 07 40 14 08 05 40 +00000130 03 09 12 03 15 0c 01 14 09 0f 0e 4e 40 40 37 08 +00000140 05 0e 05 16 05 12 40 29 6a 06 09 0e 04 40 0d 19 +00000150 13 05 0c 06 40 07 12 0f 17 09 0e 07 40 07 12 09 +00000160 0d 40 01 02 0f 15 14 40 14 08 05 40 0d 0f 15 14 +00000170 08 5b 40 17 08 05 0e 05 16 05 12 40 09 14 40 09 +00000180 13 40 01 40 04 01 0d 10 4c 6a 04 bb __ __ __ +diff --git a/puzzles/sequence/600/key b/puzzles/sequence/600/key new file mode 100644 index 0000000..7a6f1f6 --- /dev/null +++ b/puzzles/sequence/600/key @@ -0,0 +1 @@ +61 64 9b diff --git a/puzzles/sequence/500/index.html b/puzzles/sequence/700/index.html similarity index 100% rename from puzzles/sequence/500/index.html rename to puzzles/sequence/700/index.html diff --git a/puzzles/sequence/500/key b/puzzles/sequence/700/key similarity index 100% rename from puzzles/sequence/500/key rename to puzzles/sequence/700/key diff --git a/tanks/lib/GameMath.py b/tanks/lib/GameMath.py index ff47880..481bf81 100644 --- a/tanks/lib/GameMath.py +++ b/tanks/lib/GameMath.py @@ -48,7 +48,7 @@ def displacePoly(points, disp, limits, coordSequence=False): maxX, maxY = limits basePoints = [] 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 if x > maxX: diff --git a/tanks/lib/Pflanzarr.py b/tanks/lib/Pflanzarr.py index d7d50e0..ac600a2 100644 --- a/tanks/lib/Pflanzarr.py +++ b/tanks/lib/Pflanzarr.py @@ -203,17 +203,17 @@ class Pflanzarr: html = ['', '
Team | Kills | Cause of Death'] for tank in tanks: if tank is winner: rowStyle = 'style="font-weight:bold; '\ - 'background-color:%s"' % tank._color + 'background-color:%s"' % tank.color else: - rowStyle = 'style="background-color:%s"' % tank._color - if name: + rowStyle = 'style="background-color:%s"' % tank.color + if tank.name: name = xml.sax.saxutils.escape(tank.name) else: name = '#default' @@ -250,9 +250,9 @@ class Pflanzarr: clearFrames = ['rm', '-rf', '%s' % self._imageDir] print 'Making Movie' - subprocess.call(movieCmd) -# subprocess.call(movieCmd, stderr=open('/dev/null', 'w'), -# stdout=open('/dev/null', 'w')) +# subprocess.call(movieCmd) + subprocess.call(movieCmd, stderr=open('/dev/null', 'w'), + stdout=open('/dev/null', 'w')) subprocess.call(clearFrames) def _outputErrors(self, tank): diff --git a/tanks/run_tanks.py b/tanks/run_tanks.py index f680bbe..ae83990 100755 --- a/tanks/run_tanks.py +++ b/tanks/run_tanks.py @@ -1,10 +1,12 @@ #! /usr/bin/python -import optparse -import shutil -import time -import asyncore import asynchat +import asyncore +import optparse +import os +import shutil +import socket +import time from tanks import Pflanzarr T = 60*5 @@ -41,7 +43,7 @@ class Flagger(asynchat.async_chat): self.flag = team -def run_tanks(): +def run_tanks(args, turns, flagger): p = Pflanzarr.Pflanzarr(args[0], args[1]) p.run(turns) @@ -58,7 +60,7 @@ def run_tanks(): highest = gameNums[0] for num in gameNums: if highest - MAX_HIST > num and not (num % HIST_STEP == 0): - shutil.rmtree(os.path.join(path, num)) + shutil.rmtree(os.path.join(path, str(num))) try: winner = open('/var/lib/tanks/winner').read().strip() @@ -84,7 +86,7 @@ def main(): asyncore.loop(60, count=1) now = time.time() if now - lastrun >= 60: - run_tanks() + run_tanks(args, turns, flagger) lastrun = now if __name__ == '__main__': |
---|