DEATH

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

commit
8503cab73b773adba408b4804d5f9a515ccff6a2
parent
d22caa80f28957efd480148c4dd1d77318bb1b85
Author
Tobias Bengfort <tobias.bengfort@gmx.net>
Date
2014-05-25 20:07
merge death_extra into DeathCli

Diffstat

M DEATH/DeathCli.py 21 +++++++++++++++++++--
D DEATH/death_extra.py 22 ----------------------

2 files changed, 19 insertions, 24 deletions


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

@@ -2,7 +2,11 @@
    2     2 # -*- coding: utf-8 -*-
    3     3 
    4     4 import curses
    5    -1 import death_extra
   -1     5 
   -1     6 from matrix import Map
   -1     7 from death import Death
   -1     8 import win
   -1     9 import abk
    6    10 
    7    11 help = """
    8    12 Welcome to DEATH !
@@ -29,10 +33,23 @@ return with any key
   29    33 """
   30    34 
   31    35 
   -1    36 def example_game(rows=15, cols=15, n=2):
   -1    37 	map = Map(rows, cols)
   -1    38 	alive = []
   -1    39 	born = []
   -1    40 	kill = []
   -1    41 	for player in range(n):
   -1    42 		alive.append(abk.conway[0])
   -1    43 		born.append(abk.conway[1])
   -1    44 		kill.append(abk.conway[2])
   -1    45 	death = Death(map, n, alive, born, kill, win.economy)
   -1    46 	return death
   -1    47 
   -1    48 
   32    49 class DeathCli:
   33    50 	global help
   34    51 
   35    -1 	def __init__(self, death=death_extra.test(15, 15, 2), title='',
   -1    52 	def __init__(self, death=example_game(15, 15, 2), title='',
   36    53 			screen=curses.initscr()):
   37    54 		self.screen = screen
   38    55 		self.death = death

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

@@ -1,22 +0,0 @@
    1    -1 #!/usr/bin/env python
    2    -1 # -*- coding: utf-8 -*-
    3    -1 
    4    -1 from matrix import Map
    5    -1 from death import Death
    6    -1 import win
    7    -1 import abk
    8    -1 
    9    -1 "complete games"
   10    -1 
   11    -1 
   12    -1 def test(rows=15, cols=15, n=2):
   13    -1 	map = Map(rows, cols)
   14    -1 	alive = []
   15    -1 	born = []
   16    -1 	kill = []
   17    -1 	for player in range(n):
   18    -1 		alive.append(abk.conway[0])
   19    -1 		born.append(abk.conway[1])
   20    -1 		kill.append(abk.conway[2])
   21    -1 	death = Death(map, n, alive, born, kill, win.economy)
   22    -1 	return death