Permalink
Browse files

Break up into modules

  • Loading branch information...
axelson committed Jun 19, 2011
1 parent 717829f commit 16003e138093bcb41b508d38a2a8bea51b772b6f
Showing with 43 additions and 36 deletions.
  1. +36 −0 python/src/icfp.py
  2. +1 −36 python/src/play.py
  3. +6 −0 python/src/test.py
View
@@ -0,0 +1,36 @@
+def readOpponentTurn():
+ opp1 = raw_input()
+ opp2 = raw_input()
+ opp3 = raw_input()
+
+def dbl(slot):
+ print "1"
+ print "dbl"
+ print slot
+
+def zero(slot):
+ #print >> sys.stderr, "zero!"
+ print "2"
+ print slot
+ print "zero"
+
+def succ(slot):
+ print "1"
+ print "succ"
+ print slot
+
+def dec(slot):
+ print "1"
+ print "dec"
+ print slot
+
+def simpleAttack(slot):
+ zero(slot)
+ succ(slot)
+ dbl(slot)
+ dbl(slot)
+ dbl(slot)
+ dbl(slot)
+ dbl(slot)
+ dec(slot)
+
View
@@ -1,44 +1,9 @@
#!/usr/bin/env python
import sys
+from icfp import *
playerNum = sys.argv[1]
#print "I am player %s" % playerNum
-def readOpponentTurn():
- opp1 = raw_input()
- opp2 = raw_input()
- opp3 = raw_input()
-
-def dbl(slot):
- print "1"
- print "dbl"
- print slot
-
-def zero(slot):
- #print >> sys.stderr, "zero!"
- print "2"
- print slot
- print "zero"
-
-def succ(slot):
- print "1"
- print "succ"
- print slot
-
-def dec(slot):
- print "1"
- print "dec"
- print slot
-
-def simpleAttack(slot):
- zero(slot)
- succ(slot)
- dbl(slot)
- dbl(slot)
- dbl(slot)
- dbl(slot)
- dbl(slot)
- dec(slot)
-
if(playerNum == 1):
readOpponentTurn()
View
@@ -0,0 +1,6 @@
+#!/usr/bin/env python
+import sys
+
+from icfp import *
+
+

0 comments on commit 16003e1

Please sign in to comment.