From 3252b6fcaa6d5d1bb40b0c0a47bbf568f89d6e13 Mon Sep 17 00:00:00 2001 From: User Date: Mon, 9 Dec 2019 12:20:00 +0100 Subject: [PATCH 1/2] add continue in try except --- .DS_Store | Bin 0 -> 6148 bytes CONTROLLER/__pycache__/program.cpython-38.pyc | Bin 2670 -> 2677 bytes CONTROLLER/program.py | 12 +++++++----- 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..28937e785b7fc0e40a02f5b096b811a017865330 GIT binary patch literal 6148 zcmeHK%}(1u5T1olHbzx*s07EoRO%r@Nhsn_RWcztAVH}xY7eCXyN-$_<3))>)P^9x zM*9YRls-Wpr+oVZ$`2f=0PR>a-|WuJTKmbn>m?%A?8kMY3K4Or!jcDbi>SEL8JV*^ zi$JEw*rz?(!PBPwnQYhL7;p?cGzQe#^=J$0_B|b7)!wY%?Nok^QW+txHix&+*Z;J@ zyQ3x=^v-O}pXe-2dU>t(m(9(W7M?9~?s4zA_a!)ygCGy{ey45q%%0Gyxfvm9wu3*tBaGkgOtNhNfygNQ}(mCr^g9Qfb%jhA5~U{!?nhGRn!}A zMpZG~*r-*-dSh)gD)Z%6^>^FHr{8}JFGiO?^>m0~1Jm-t;x+t&b1OmTK{rcf_6>1W zyFj}juZ68|XNtPth>lY?mibf(8=K-3O=WyzZQ2A;yTDaCrFfDqwmd}_nojP80sG1G zrF$9O4eA(h3_NBA)czo#3Vn-(LA`ar=qmuQgl;YH)$f9;5f*)mg+W9h%#;F6DYI7$ zX3EhoY@TniFlfq&*~B!e1pz91{?#E49uHmMVPU4l$V!_0SK~m-^HHZ$Q#0LVFct=36(IEFs3jz17QtAJX1JBo&+NU2$nFX zFf}tWGDI>I0&yNw1Var&7E>^TCd=fh?7obClOM60@$-O8WM*O%Vq|0FVC34Y%Avu? Q7&O_Ba}OieWNxlx06p3l`2YX_ delta 114 zcmew=@=k;|l$V!_0SJ1X-o|!q Date: Mon, 9 Dec 2019 14:35:29 +0100 Subject: [PATCH 2/2] change method play again --- CONTROLLER/__pycache__/main.cpython-38.pyc | Bin 629 -> 636 bytes CONTROLLER/__pycache__/player.cpython-38.pyc | Bin 1235 -> 1246 bytes CONTROLLER/__pycache__/program.cpython-38.pyc | Bin 2677 -> 2658 bytes CONTROLLER/main.py | 8 +++++--- CONTROLLER/player.py | 2 ++ CONTROLLER/program.py | 9 +++++---- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CONTROLLER/__pycache__/main.cpython-38.pyc b/CONTROLLER/__pycache__/main.cpython-38.pyc index 7a575b57d67c3718914206fbfe6d5cbd31ca6576..8a7f991b9f67b838ee5af2c43da4a47144d0539b 100644 GIT binary patch delta 254 zcmey$@`r^tl$V!_0SGQSy^H-akyn;+!$fT<#x)b&H0o11Q&_T@iuzJmqqtHz7I3FB zWbrIyWMlxcc^5K(X+9{;52XcwY6Mfc7BZ!<0d+d0GN-UN19cSk6*{D{H#0;Dr3x(& z2CIdby#}a)1EeB_HJCw@^Cie7nvAy?wQh05PkbsX$(f#*o2rmsmReNBU6fjolUS(- z0-7R|1sFpn7cov@lK|={l9vamk$0Q4RBmcXMt+JyT7Hp2W?p7VW@1idajHUIVs7fh gmx~$MCigP#W8~TF!?co-QE2iv=824qlRH?#00{XSk^lez diff --git a/CONTROLLER/__pycache__/program.cpython-38.pyc b/CONTROLLER/__pycache__/program.cpython-38.pyc index d5f88e6e5663e0a08bcb62014373447254236ba0..f0459d6488eb736be0da0c3b197c0e1102744d3f 100644 GIT binary patch delta 669 zcmZuv%}U%*6uu{OZzf46qjq8)k>b?BpJ|t+rBImd>;_7af>1)7+)g7IqbE`PD_!^q zw=W@G72lvffXl+rjeUTEi!QqBIZ;ro3HRgVoG;(`a!&pPzXE^N_dP+^dGGi8zu)|2 zfEDus78-CQLKTa*qGRPLZ=$;B(d;>LM&FfjP5&w%NvAj*ro1oQ=Z4$1EA>rukm^vUneF zB8uZMP4eQJxpaCco6vknk_WQeI{buF+)@ov9U%tht9srjtwD0TrMXlMcxse=?z_bA zC}a}4=E80~n`edU^>^QXi}STXHrk3%mnOPqzWSrh3OL7bk7Im7g`Syp_7;YMMr|F5 z4H|Y)iRCeXDCDsKu`Oan3$V?p^X}DwGt9EMwZ5fgc5Z!V7v2pE`&>*6MP)KQu4?%02<1ltmTgs_F zVSD5szyZY10Er`##fcx#8+Ue`Qlu)j=4s@4`(`|Ee|P?L!slV=GxLmZoxJ+?CENtK zt?xm9)jDLcBf+36*)tY31_*|>9eH{TkHP>|F-yxhO^UM6pWzCG`a9eYnub%fNDy4z zwq_fFNh>E+Z&iw+$>%_fsyR|dfGR8cll5zD>8xB6Yfgw_BJ(UBzRr`Ox~xAoj@K9Q zmW7n{FsID*uhQ;9cg08^*jv4K@9`qFbcU%Ch?n%Sb9b{I4U+R?wQ5dWD$J6JNF#mX z{CGk;iX5aPNcm1U#e9S!n{NPn=3C`WX4$U7;=E!o%(JOLRdXL|?)_XN4ZKRQ;BT;R z3XiqL_xjQ{4zNQuHXf9gbdCU6**Idr-Z1GJUp)PRzl^sJ_$be1Z+Bk}A{#jgZ~SXf z*=jE-7d5Kd(^TxoVkDBu>EfQ6Q*#5Y4*2GE!ENXl%|W_MdToL(!79OZf*S-hGTtQk z@A8?AXq$p(q97MI*uZ^m^OlJYU*djUkGvgs?lxZ27ySO61ws{nkmYigsx7*V1#OW7 Jhrk54{sIXUlSBXj diff --git a/CONTROLLER/main.py b/CONTROLLER/main.py index b6b89f9..ee6811c 100644 --- a/CONTROLLER/main.py +++ b/CONTROLLER/main.py @@ -11,7 +11,6 @@ # ask method for choice level of game player.level_choice() game = Program() - result_lists = True play_again = True while play_again == True: numbers = None @@ -25,10 +24,13 @@ game.clear_terminal() # ask method for compare number user and program list if game.compare_list(player.player_numbers, numbers) == False: + print("game over") break pursuite = Program() - if pursuite.play_again_choice() == True: + pursuite.play_again_choice() + if play_again == True: print("replay.....") - + + diff --git a/CONTROLLER/player.py b/CONTROLLER/player.py index 1299c82..f15b260 100644 --- a/CONTROLLER/player.py +++ b/CONTROLLER/player.py @@ -2,6 +2,8 @@ from time import sleep from program import * class Player: + """class for player entry name and level""" + """method for initialyse name""" def __init__(self): self.name = "" diff --git a/CONTROLLER/program.py b/CONTROLLER/program.py index 6e72fe4..ccc0ed8 100644 --- a/CONTROLLER/program.py +++ b/CONTROLLER/program.py @@ -6,13 +6,14 @@ class Program: """class for program controller """ + + """method for initialyse many attibutes """ def __init__(self): self.program_list = [] self.numbers_program = None self.number_user = 0 self.level_choice = None self.play_again = None - self.result_lists = True self.player_numbers = 0 @@ -67,8 +68,6 @@ def compare_list(self, player_numbers, program_lists): numbers = False return numbers - #pursuite = self.play_again_choice() - def player_numbers_entry(self): """method for verify if number is an integer""" while True: @@ -84,8 +83,10 @@ def play_again_choice(self): while self.play_again != "yes" or self.play_again != "no": self.play_again = input("do you want to play again enter yes or no :") if self.play_again == "yes": - self.play_again = True + self.program_list = [] return self.play_again + #self.play_again = True + #return self.play_again else: print("good bye")