DEATH

a multiplayer variant of conways game of LIFE
git clone https://git.ce9e.org/DEATH.git

commit
3c09e40f2ead2ec4043082b013a9bb87de0c11f2
parent
91ca0f049696bd571c806c0e25930549fceb9135
Author
Tobias Bengfort <tobias.bengfort@gmx.net>
Date
2014-05-25 19:40
minor improvements

Diffstat

M DEATH/death.py 7 +++----

1 files changed, 3 insertions, 4 deletions


diff --git a/DEATH/death.py b/DEATH/death.py

@@ -22,7 +22,7 @@ from matrix import Map
   22    22 class Death:
   23    23 	def __init__(self, _map=Map(), n=1, alive=[[2, 3]], born=[[3]], kill=[[]],
   24    24 			win=lambda _map, n: None):
   25    -1 	# the defaults make death the standart life
   -1    25 		# the defaults make death the standart life
   26    26 		self.n = n
   27    27 		self.alive = alive
   28    28 		self.born = born
@@ -32,6 +32,7 @@ class Death:
   32    32 		self._win = win
   33    33 
   34    34 	def step_one(self, id):
   -1    35 		# main logic of the game
   35    36 		def f(x):
   36    37 			if x[0] == 0:
   37    38 				if x[1] in self.born[id]:
@@ -56,9 +57,7 @@ class Death:
   56    57 			self.step_one(id)
   57    58 
   58    59 	def next(self):
   59    -1 		self.id += 1
   60    -1 		if self.id == self.n:
   61    -1 			self.id = 0
   -1    60 		self.id = (self.id + 1) % self.n
   62    61 
   63    62 	def count(self):
   64    63 		c = []