From af5e4465d4c19a7f94b9c98ac76164a9193e2cdb Mon Sep 17 00:00:00 2001 From: luxick Date: Thu, 23 Jul 2015 22:08:54 +0200 Subject: [PATCH] moved testsection from mayor file to test file --- mayorgotchi.py | 31 +------------------------------ mayorgotchi.pyc | Bin 0 -> 1576 bytes tamagotchi.pyc | Bin 3847 -> 3847 bytes test.py | 35 +++++++++++++++++++++++++++++++++++ util | 3 --- 5 files changed, 36 insertions(+), 33 deletions(-) create mode 100644 mayorgotchi.pyc create mode 100644 test.py delete mode 100644 util diff --git a/mayorgotchi.py b/mayorgotchi.py index 4dd1a2d..9f9e4e6 100644 --- a/mayorgotchi.py +++ b/mayorgotchi.py @@ -1,13 +1,8 @@ #!/usr/bin/python from tamagotchi import Tamagotchi -from util import Util import names -decayaspeed = 1 -ticks = 50 -show_pct = True - class Mayorgotchi: mygotchis = [] name = '' @@ -21,7 +16,7 @@ class Mayorgotchi: if n.is_dead(): self.mygotchis.remove(n) - def give_status(self): + def give_status(self,show_pct): result = 'I am Mayorgotchi ' + self.name + '. These are the Tamagotchis in my Village:\n\n' for n in self.mygotchis: if show_pct: @@ -34,27 +29,3 @@ class Mayorgotchi: for n in self.mygotchis: n.step() self.remove_corpses() - - -# Temoprarty Test Section -list = [] -for n in range(0,10): - list.append(Util().make_Tamagotchi()) - -mayor = Mayorgotchi(list) - -print mayor.give_status() - -for n in range (0, ticks): - mayor.step() - -print '----------------------After '+str(ticks)+' ticks------------------------------\n' - -print mayor.give_status() - -for n in range (0, ticks): - mayor.step() - -print '----------------------After another '+str(ticks)+' ticks------------------------------\n' - -print mayor.give_status() diff --git a/mayorgotchi.pyc b/mayorgotchi.pyc new file mode 100644 index 0000000000000000000000000000000000000000..303e3f3a6f96537149da20bedbdb9874d9d1821c GIT binary patch literal 1576 zcmb_cQBM;=5T3m&#a1vNCOpW)y_odDP!k_8#26#K@E{KdN^D{_=XGfh?s}!Wg*JgF zO#D6mHh+MA-(E}c**3S+nc3N$nQvw`{Jq}%dHCydDzjgR|Myt-HAokql3b)v(ov!) z2a*TU38WiJcSX82`5|&A^0fmwkmFVz=dwTewG=ql1UX5Hq*uDMpB=f!kUu5Ua#Shq z{nGdYmVEKY)$w2II=UOGq$W8FHqo^d))tkYCEnv-eKmzS)`&)gQI zJcChrrrmw^wgt6#V)wwc`(`gI zF$nsk%5@u!vV9xKWZx?kl5fjx$UH|-A>nY=0(-E!d_Gr&1ZJi>h1qe7_aE6!(8DMx zq6f_z*_Y7nMkjq^O_YpGS5~q zu-HmWzT3*!Bg=~0etGS!D(vkzckvqZO9GsO*~_kst^!~OTV5|}6L{CvR`6`mU+giD zIRTgeyjg#3{L^3Trc-YDQRC||pE6=vA;1b+XNECn%TJN-r6pz-GnE~>nK#c9)gqv? zIpX+g?XlOoD7)hvq7SYr6dwa0UHp_BZ(Bg_x&ImFm_x(BJlJ&rT@M;l2XSE=0H*(?A~;Rb#H delta 23 ecmZpdYnNkV{>;m@$z~(l6fPzsgUxfevRMFARR+xf diff --git a/test.py b/test.py new file mode 100644 index 0000000..79ddb1b --- /dev/null +++ b/test.py @@ -0,0 +1,35 @@ +#!/usr/bin/python + +from mayorgotchi import Mayorgotchi +from util import Util + + +# Temporary test section + +# Variable Definition +decayaspeed = 1 +ticks = 50 +show_pct = True + +list = [] + +for n in range(0,10): + list.append(Util().make_Tamagotchi()) + +mayor = Mayorgotchi(list) + +print mayor.give_status(show_pct) + +for n in range (0, ticks): + mayor.step() + +print '----------------------After '+str(ticks)+' ticks------------------------------\n' + +print mayor.give_status(show_pct) + +for n in range (0, ticks): + mayor.step() + +print '----------------------After another '+str(ticks)+' ticks------------------------------\n' + +print mayor.give_status(show_pct) diff --git a/util b/util deleted file mode 100644 index b46f1b1..0000000 --- a/util +++ /dev/null @@ -1,3 +0,0 @@ -#! /usr/bin/python - -class util: