added Kinggotchi, multiple Villages in Kingdom

This commit is contained in:
luxick
2015-08-23 15:35:54 +02:00
parent f6d1abe23a
commit 15983586fc
3 changed files with 37 additions and 11 deletions

19
test.py
View File

@@ -1,20 +1,24 @@
#!/usr/bin/python
from mayorgotchi import Mayorgotchi
from kinggotchi import Kinggotchi
from util import Util
from config import *
import time
import curses
# Temporary test section
list = []
ticks = 0
for n in range(0,startnr):
list.append(Util().make_Tamagotchi())
mayor = Mayorgotchi(list)
def make_list(number):
list = []
for n in range(0,number):
list.append(Util().make_Tamagotchi())
return list
king = Kinggotchi()
for n in range(0, 10):
king.add_village(Mayorgotchi(make_list(startnr)))
screen = curses.initscr()
curses.noecho()
@@ -24,11 +28,10 @@ screen.nodelay(1)
while True:
screen.move(0,0)
mayor.step()
screen.addstr('Simulation running. Press [q] to exit.\n')
screen.addstr('----------------------After '+str(ticks)+' ticks------------------------------\n')
#screen.addstr(mayor.give_status(show_pct))
screen.addstr(mayor.give_overview())
screen.addstr(king.show_kingdom())
king.step()
ticks += 1
screen.clrtobot()