Permalink
Browse files

format source codes

  • Loading branch information...
1 parent cdbe525 commit 40adecd055e0ced306cb8fd39044b677c4edc852 @halida committed Feb 27, 2012
Showing with 535 additions and 958 deletions.
  1. +6 −0 examples/ai_halida.py
  2. +1 −1 makefile
  3. +0 −35 srcs/dynamic_wall.py
  4. +377 −11 srcs/game.py
  5. +129 −0 srcs/map/four_side.yml
  6. +0 −1 srcs/map/map.py
  7. +21 −72 srcs/map/test.yml
  8. +0 −163 srcs/random_wall.py
  9. +0 −50 srcs/simple.py
  10. +0 −595 srcs/snake_game.py
  11. +0 −30 srcs/snake_profile.py
  12. +1 −0 tmp/placeholder.txt
View
@@ -0,0 +1,6 @@
+#!/usr/bin/env python
+#-*- coding:utf-8 -*-
+"""
+module: ai_halida
+"""
+
View
@@ -1,6 +1,6 @@
#-*- coding:utf-8 -*-
unittest:
- python srcs/snake_game.py
+ python srcs/conquer_game.py
python srcs/game_controller.py
python srcs/ailib.py
View
@@ -1,35 +0,0 @@
-#!/usr/bin/env python
-#-*- coding:utf-8 -*-
-"""
-module: dynamic wall samples
-"""
-
-from snakec.game import *
-
-class FanWallGen(WallGen):
- freq = 2 # fan frequence
- flen = 4 # fan length
-
- # fan movement offest
- offset = [[(-1,0), (1,0), (0,-1), (0,1)], \
- [(-1, -1), (-1,1), (1,-1), (1,1)]]
-
- def can(self, ctx):
- return ctx.round % self.freq == 0
-
- def gen(self, ctx):
- ct = [ctx.size[0]/2, ctx.size[1]/2]
- walls = [ct]
- ang = (ctx.round / self.freq) % 2
-
- def move(pt, of):
- return [pt[0]+of[0], pt[1]+of[1]]
-
- for of in self.offset[ang]:
- pt = ct[:]
- for i in range(self.flen):
- pt = move(pt, of)
- walls.append(pt[:])
-
- return walls
-
Oops, something went wrong.

0 comments on commit 40adecd

Please sign in to comment.