Commits

mcc committed d3feada

Giants

  • Participants
  • Parent commits 980a816

Comments (0)

Files changed (1)

File server/server.py

 define("database", default='database.db', help="database filename", type=str)
 define("tanks", default=5, help="number of tanks", type=int)
 define("specs", default=10, help="species per tank", type=int)
-#define("giants", default=0, help="how many giants?", type=int)
+define("giants", default=0, help="are there giants?", type=int)
 define("shelf_after", default=0, help="where is shelf?", type=int)
 define("shelf_size", default=-1, help="how big is shelf?", type=int)
 define("input", default='', help="initialize state from log", type=str)
 		return r
 	
 class Spec:
-	def __init__(self, gid, suppress = False):
+	def __init__(self, gid, suppress = False, size=None):
 		self.gid = gid
 		self.sid = -1
 		self.checked = False
 		self.won = False
 		if not suppress:
-			self.board = Board()
+			if not size:
+				self.board = Board()
+			else:
+				self.board = Board(size,size)
 		
 	def clone(self):
 		c = Spec(self.gid, True)
 		self.id = _id
 		self.specs = {} # Unordered
 		self.specs_stack = [] # Ordered
-		basic = Spec(self.id)
+		size = None
+		if options.giants and _id == options.tanks:
+			size = 32
+		if options.giants and _id == options.tanks-1:
+			size = 16
+		if not size:
+			basic = Spec(self.id)
+		else:
+			basic = Spec(self.id, False, size)
 		self.issue_next = 0
 		self.generation_count = 1
 		self.id_generator = 0