From d084a284f78ec756fb3557872e71b374b00507d0 Mon Sep 17 00:00:00 2001 From: nicos Date: Tue, 3 Dec 2019 19:56:37 +0100 Subject: [PATCH 01/29] create readme in controller and model folders --- CONTROLLER/README.md | 0 MODEL/README.md | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 CONTROLLER/README.md create mode 100644 MODEL/README.md diff --git a/CONTROLLER/README.md b/CONTROLLER/README.md new file mode 100644 index 0000000..e69de29 diff --git a/MODEL/README.md b/MODEL/README.md new file mode 100644 index 0000000..e69de29 From 79761b16e6a7040e2b3d72d9fe1252290889c005 Mon Sep 17 00:00:00 2001 From: nicos Date: Wed, 4 Dec 2019 10:35:49 +0100 Subject: [PATCH 02/29] create main.py --- CONTROLLER/main.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 CONTROLLER/main.py diff --git a/CONTROLLER/main.py b/CONTROLLER/main.py new file mode 100644 index 0000000..e69de29 From 12d44910754f969edc1f65a37f073fd181d8b2b3 Mon Sep 17 00:00:00 2001 From: nicos Date: Wed, 4 Dec 2019 15:15:11 +0100 Subject: [PATCH 03/29] write method name_entry and level_choice --- CONTROLLER/__pycache__/player.cpython-36.pyc | Bin 0 -> 1034 bytes CONTROLLER/__pycache__/program.cpython-36.pyc | Bin 0 -> 1095 bytes CONTROLLER/main.py | 16 ++++++++++++++ CONTROLLER/player.py | 20 ++++++++++++++++++ CONTROLLER/program.py | 19 +++++++++++++++++ 5 files changed, 55 insertions(+) create mode 100644 CONTROLLER/__pycache__/player.cpython-36.pyc create mode 100644 CONTROLLER/__pycache__/program.cpython-36.pyc create mode 100644 CONTROLLER/player.py create mode 100644 CONTROLLER/program.py diff --git a/CONTROLLER/__pycache__/player.cpython-36.pyc b/CONTROLLER/__pycache__/player.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6eb02cc70200fb4f07173619c35e209b08827a11 GIT binary patch literal 1034 zcmZuwOK;RL5VrH$G-`S70aYA);6OyROWWHD0aAsyRNJZ`A+3b05PR9Qd2F2ok;5^JIJFe?KM8cc8%{5dZQuw)JaRO7>UiG)yx26UaacYC~l zZEhgOpr)gT@GywC0I_vqtEa&2o;%2)0{0k@A445CDzPg^c%25c_66uE5d)Zr-#%QK zY+XWy@uEm#$;^BdBGq(T(;ZEB+ZWJ=FXyc5L|$hfz`U3>va*U)#c2!zl}P)Ztl5R_%nD2`yIb$9JUd~IH) zPmp)fwTIGI=&3W3rNp7M2d|hP?F{qH$m4gTQS|x#=NHKt`@tR^AN>;)_Zk&2;F?`^ z_5%YC{5uBzH!tB3d}6cSFU(^zUhy|6dF}DgIYDuxGKSeK@qj0OQy~c;fZiQTdeDau zZ65>-(1sAf0a^h=7@-}&7%7t~{AkU>s$%mh)ylc)wXxG>b2Uv(xw1y<%uZ9Br#@s! zPElNd3K-Vm@ptMqaGAcgbX%+6Z|66r$mV698aH=&VM@7BcyW3WUtM0DpPyaMx2&V( zZ6&14%X}qek80DPjBgIN{T;Qzov*Rm3CB*nip38dJo5Tjt{PcYf+=KrWAZc;#39V) zc}v-e{|{xUz&~gc1t4|qR$E@w@m{vPCmH(^$EnVgm8;Aad8zcU1HNd1y9xX9CQZ4u z%WOU9xC3?*KFQdZ7%jEBm1?2#^00$FYo~h%#F4ZvWlcE46HTzLn*(mmEJ}| zDZ!*t+7PSR0V(>K>;WnIes)Bv+v&!mWwJgh5=T=D9&q6cuX*ZNjLX=kjxt-n|E)+R Q-ZzaM(<;}0D8U8)1NiRTaR2}S literal 0 HcmV?d00001 diff --git a/CONTROLLER/main.py b/CONTROLLER/main.py index e69de29..adfe370 100644 --- a/CONTROLLER/main.py +++ b/CONTROLLER/main.py @@ -0,0 +1,16 @@ +#! /usr/bin/env python3 +# coding: utf-8 +from player import * +from program import* + +if __name__ == "__main__": + print("Hello start game") +player = Player() +#ask method name entry in player.py +player.name_entry() +#ask method level choice for user select level +player.level_choice() +#show name and choice user + +#ask method for display choice game of user +#show_information.display_name_choice() \ No newline at end of file diff --git a/CONTROLLER/player.py b/CONTROLLER/player.py new file mode 100644 index 0000000..4692211 --- /dev/null +++ b/CONTROLLER/player.py @@ -0,0 +1,20 @@ +class Player: + """method for initialyse name""" + def __init__(self): + self.name = None + self.level = None + + """method for ask and save name entry""" + def name_entry(self): + name = "" + while name == "": + name=input("...enter your name :") + self.name = name + + def level_choice(self): + """method for user choice level""" + level = "" + while level != "1" and level != "2" and level != "3": + level = input("...{} enter number of difficulty choice\n 1:easy 2:midle 3:hard\n".format(self.name)) + self.level = level + print("{} you choice level {} start game ..........".format(self.name, self.level)) diff --git a/CONTROLLER/program.py b/CONTROLLER/program.py new file mode 100644 index 0000000..d138a18 --- /dev/null +++ b/CONTROLLER/program.py @@ -0,0 +1,19 @@ +from player import * +from player import * +class Program: + """class for program controller """ + def __init__(self): + pass + def random_choice(): + """""" + def add_list_choice(): + """""" + def clear_terminal(): + """""" + def clear_user_list(): + """""" + def play_again(): + """""" + + + \ No newline at end of file From 76b4c76fb9a87bdceabbee152017e93b92da0c4e Mon Sep 17 00:00:00 2001 From: nicos Date: Wed, 4 Dec 2019 16:52:11 +0100 Subject: [PATCH 04/29] write method random choice and add_list_choice --- CONTROLLER/__pycache__/player.cpython-36.pyc | Bin 1034 -> 1034 bytes CONTROLLER/__pycache__/program.cpython-36.pyc | Bin 1095 -> 1438 bytes CONTROLLER/main.py | 12 ++++-- CONTROLLER/program.py | 38 +++++++++++++----- 4 files changed, 37 insertions(+), 13 deletions(-) diff --git a/CONTROLLER/__pycache__/player.cpython-36.pyc b/CONTROLLER/__pycache__/player.cpython-36.pyc index 6eb02cc70200fb4f07173619c35e209b08827a11..c772a8328c37d88790841533712719b9dbab8110 100644 GIT binary patch delta 24 fcmeC;=;Gis=H=xwI`TaB#70gZW=6)zVa!_qRX_(a delta 24 gcmeC;=;Gis=H=x&wC{QB)s37!%#2Kv!I+qSOKnuVx^pa9Y2)N>vERBj;E=_R4SssTG zQzDaj%B&yk8pCoe0l@8`jhis0kwQjQW3J+?7*d7QjDr?@-0WFP+}iEHlJ)?I)1~F( zn*WB*h7+q?JcTnr8;AosNWO6K+qgl&4X4}_QnDgvQ93U!80MtrZ!aGYJ%x8yO);NG z-~zH&U4Z{^AAmuV&?Wl;s4m&}X}MdozooTN&lot91iV;Up0C%#okYS^ByeV8Qa~-r zSc`cgE|%oSYZ1lbS&MBy#M2xOrEw;bM@SC_DR*jWn+o?bdtvk$7V<{?uxrFr#2HIP z7S5tOI1TKTt6tb$ky^#;md3rT_Jsb5dBvarv3SB}u{K|p)E#U(c!nG5*abE^+jVqq zHpjybwpj*E$a&S_Jk8}ILAlHMw}nWSJ1x#-9&)bQU`_Q9uqf0P!b5~@gqu7W2^&GV s0626Xz^5Md8|HO=*X-dBrDGAZ~y=R literal 1095 zcmbu8&1%~~5P)|j*;*_935B+&g6Ykr#D`u>2!zl}P)Ztl5R_%nD2`yIb$9JUd~IH) zPmp)fwTIGI=&3W3rNp7M2d|hP?F{qH$m4gTQS|x#=NHKt`@tR^AN>;)_Zk&2;F?`^ z_5%YC{5uBzH!tB3d}6cSFU(^zUhy|6dF}DgIYDuxGKSeK@qj0OQy~c;fZiQTdeDau zZ65>-(1sAf0a^h=7@-}&7%7t~{AkU>s$%mh)ylc)wXxG>b2Uv(xw1y<%uZ9Br#@s! zPElNd3K-Vm@ptMqaGAcgbX%+6Z|66r$mV698aH=&VM@7BcyW3WUtM0DpPyaMx2&V( zZ6&14%X}qek80DPjBgIN{T;Qzov*Rm3CB*nip38dJo5Tjt{PcYf+=KrWAZc;#39V) zc}v-e{|{xUz&~gc1t4|qR$E@w@m{vPCmH(^$EnVgm8;Aad8zcU1HNd1y9xX9CQZ4u z%WOU9xC3?*KFQdZ7%jEBm1?2#^00$FYo~h%#F4ZvWlcE46HTzLn*(mmEJ}| zDZ!*t+7PSR0V(>K>;WnIes)Bv+v&!mWwJgh5=T=D9&q6cuX*ZNjLX=kjxt-n|E)+R Q-ZzaM(<;}0D8U8)1NiRTaR2}S diff --git a/CONTROLLER/main.py b/CONTROLLER/main.py index adfe370..007c1b0 100644 --- a/CONTROLLER/main.py +++ b/CONTROLLER/main.py @@ -10,7 +10,11 @@ player.name_entry() #ask method level choice for user select level player.level_choice() -#show name and choice user - -#ask method for display choice game of user -#show_information.display_name_choice() \ No newline at end of file +game = Program() +#ask method random number +game.random_choice() +#ask method for save number in list +game.add_list_choice() +#method for clear +game.clear_terminal() +# \ No newline at end of file diff --git a/CONTROLLER/program.py b/CONTROLLER/program.py index d138a18..e4bf219 100644 --- a/CONTROLLER/program.py +++ b/CONTROLLER/program.py @@ -1,19 +1,39 @@ from player import * -from player import * +from random import * class Program: """class for program controller """ def __init__(self): - pass - def random_choice(): - """""" - def add_list_choice(): - """""" + self.program_list = [] + self.user_list = [] + self.numbers_program = None + + def random_choice(self): + """method for choice random number """ + self.numbers_program = randrange(1, 100) + print(self.numbers_program) + + def add_list_choice(self): + """add to empty list number choice""" + self.program_list.append(self.numbers_program) + print(self.program_list) + def clear_terminal(): - """""" + """method for clear prompt after disaplay number""" + + def player_entry(): + """save number entry user """ + + def add_user_list(): + """save in list number entry user""" + + def compare_list(): + """compare list user and list program """ + def clear_user_list(): - """""" + """clear user list number for again manche""" + def play_again(): - """""" + """ask to player if his play again""" \ No newline at end of file From 41a904e2784e333d2f3b6827f69fb818361184e4 Mon Sep 17 00:00:00 2001 From: nicos Date: Wed, 4 Dec 2019 20:25:45 +0100 Subject: [PATCH 05/29] write method player_entry, add_user_list, and compare_list --- CONTROLLER/__pycache__/player.cpython-36.pyc | Bin 1034 -> 1034 bytes CONTROLLER/__pycache__/program.cpython-36.pyc | Bin 1438 -> 2104 bytes CONTROLLER/main.py | 7 +++++-- CONTROLLER/player.py | 2 +- CONTROLLER/program.py | 17 ++++++++++++++--- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/CONTROLLER/__pycache__/player.cpython-36.pyc b/CONTROLLER/__pycache__/player.cpython-36.pyc index c772a8328c37d88790841533712719b9dbab8110..09a9ff546b82009447fb9ead486d3c002b77bc45 100644 GIT binary patch delta 18 ZcmeC;=;Gis=H=zGx&A!%)J9H57633b1!VvL delta 18 ZcmeC;=;Gis=H=xwI`TaB#70g=7630e1x5e> diff --git a/CONTROLLER/__pycache__/program.cpython-36.pyc b/CONTROLLER/__pycache__/program.cpython-36.pyc index 7c88a19a393a2ad25d6b6f0388d3b098df826353..29dcf715b0182dffdb55c467abf0b2235ed824c2 100644 GIT binary patch literal 2104 zcmah}O>f&q5ZxsyiIOGDac!q9+Js0BtWtS>o zB0V{OrhkdoUh2QlQ{U`Tvg9T7%>M*NLMnP?@SeK zn0U>wJyfKLuA2Tz$I4E}`6~N8R$8W30Nlg0?jCajjAH1|ao~})H9Hb-~ z2S3N8LK3BO>A)#oLB8gfoFj#B&#Qwhu9k%~VT+bU62*ZEb6I48^&+?;|F0y(bmGqX z^b=zdt1gzBPN|Z-ns7znjEhzb=;z3uB<#6+SkfK@bB4S=UgO`f*>PegOMngFkPd;b zT>3U{aLQ8sFqAT=iXhI)>LQ>Nt?}E-rxQ=n-Ay+v%NQ;YdbJPn5$t0eX!6^lKY(eA zexKL(*XVCp?Nk5-&Ln{@mKNuC+u=^*&~O!)gK%Dfr83cBnT8iF_~}+ei9TDg-H&Lu zz@{w8!}OToVX*pS4Q_QL&0kP~wvR$=?z49Yohs#6fJ``o0eTh}Yqa zQBfBGQ9G!Q@B!WOKR7iHBHg&)MAJ#~a#g7wuCRf2EJ@754R40zGz!X`{wa27$`28x z%j=`HN83glfBsj`cQECF@g~W4NOJ8J5rwKvQNp*te}v(b|4l2PXkK$ zorD{Mzj4$_g&sug&V9@blQ4FSVo z*Clwv;!ac#L;Z$Yg=JHa%!6g3&6fpr3z`A#5eE9{2FT$yJ?+owWJJ9?M`stJ83>UT za+T72D8$=Un6`grQ9a}Kleo;R(T<5=e(pO-VGv6gt=+$_{HE?E&Xk_Bl})faG#_iZ1yY89ndFNhgX;kl-F83mmsw3##6ea51}^{^M~8rK11G<-%0C^JTD9qM{$B z5n(|cu`J0+x&!aZ0krxEs6HOcU8#i2UAu0ph>5N}Sn2doE=eWUtuiI|0f|YH4`5*o wu?0(Gau|Un9>*5PHiyg*iU%>J1HV Date: Wed, 4 Dec 2019 20:39:12 +0100 Subject: [PATCH 06/29] started creation of method clear_terminal --- CONTROLLER/__pycache__/player.cpython-36.pyc | Bin 1034 -> 1034 bytes CONTROLLER/__pycache__/program.cpython-36.pyc | Bin 2104 -> 2149 bytes CONTROLLER/main.py | 2 +- CONTROLLER/program.py | 4 +++- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CONTROLLER/__pycache__/player.cpython-36.pyc b/CONTROLLER/__pycache__/player.cpython-36.pyc index 09a9ff546b82009447fb9ead486d3c002b77bc45..b8ee5cd4b5d350236225e21481897dfa34cb622a 100644 GIT binary patch delta 16 XcmeC;=;B~E=H=z`W`D7fotXsy9*P5e delta 16 XcmeC;=;B~E=H=zGx&C}3J2MLaBK!nA diff --git a/CONTROLLER/__pycache__/program.cpython-36.pyc b/CONTROLLER/__pycache__/program.cpython-36.pyc index 29dcf715b0182dffdb55c467abf0b2235ed824c2..991ce380ac83bceca1e19ad7c105b76968a708e9 100644 GIT binary patch delta 351 zcmYk1Jxc>Y5Qca5%QYH}n2$3m+C;d3M6nf#m0cQRbC}|AuaP?=w^2wP3pOz_EicsVoS|+7#Sb=vCO+{Dw((57 zLkqX$BkW=(?_m#*=gylo>q|X{HHUSF4Tnv9kd1EYj^wsY)j|OWC6%zn3ss604xi`p kIu6HC8pt%f(!(TObs@}#c%C{;hWaLsj=%-UB1nOPUnnd^)c^nh delta 275 zcmaDVutOlkn3tDJgZ)Kp9xDUGV+JI^3}ib1aj_DRNMT4}%wY(D(2OAr?hGkRDa(LFM;Y9G#PI(YHf^-Vq|2Uyo2#DBlqMQroD^;ldYK5CNr`tOzvXV zo9xIgJ^3j!Kc^_jbdaXW|CtXnN=!b?vV&1>at-TAM&-$FY%>_OC*No5VAPwO!5$+e z1XNZ8(oiG@A|ybBB#4lje2-nm9OT$y5g@_A$im3M#=#1N%wU>>gSiMK>!-
  • )9h fu`;zNimfOyFC{;>h#9C?e6kM*KL-m~D+eP0eg!s2 diff --git a/CONTROLLER/main.py b/CONTROLLER/main.py index 90f9052..d045f96 100644 --- a/CONTROLLER/main.py +++ b/CONTROLLER/main.py @@ -16,7 +16,7 @@ #ask method for save number in list game.add_list_choice() #method for clear -#game.clear_terminal() +game.clear_terminal() # game.player_entry() game.add_user_list() diff --git a/CONTROLLER/program.py b/CONTROLLER/program.py index 458f030..6dee919 100644 --- a/CONTROLLER/program.py +++ b/CONTROLLER/program.py @@ -1,5 +1,6 @@ from player import * from random import * +import os class Program: """class for program controller """ def __init__(self): @@ -18,8 +19,9 @@ def add_list_choice(self): self.program_list.append(self.numbers_program) print(self.program_list) - def clear_terminal(): + def clear_terminal(self): """method for clear prompt after disaplay number""" + os.system("clear") def player_entry(self): """save number entry user """ From a02e9934412ef271c804616b5eb3e6f40fc634ed Mon Sep 17 00:00:00 2001 From: nicos Date: Thu, 5 Dec 2019 09:07:04 +0100 Subject: [PATCH 07/29] create new class player game and change method player entry and add user list to this class --- CONTROLLER/__pycache__/player.cpython-36.pyc | Bin 1034 -> 1034 bytes .../__pycache__/player_game.cpython-36.pyc | Bin 0 -> 959 bytes CONTROLLER/__pycache__/program.cpython-36.pyc | Bin 2149 -> 1750 bytes CONTROLLER/main.py | 6 +++--- CONTROLLER/player_game.py | 16 ++++++++++++++++ CONTROLLER/program.py | 10 +--------- 6 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 CONTROLLER/__pycache__/player_game.cpython-36.pyc create mode 100644 CONTROLLER/player_game.py diff --git a/CONTROLLER/__pycache__/player.cpython-36.pyc b/CONTROLLER/__pycache__/player.cpython-36.pyc index b8ee5cd4b5d350236225e21481897dfa34cb622a..bc33554e4d3bd5808b9d7c58e99e19c0d40fd2f8 100644 GIT binary patch delta 15 WcmeC;=;B~A=H=xw3B8n)o=4dW6f>#w`5id)2Sv>`$iRtWYhNKg_6J^49a$m+r z@F9GGT)pTkc(SS!hY5D*s_w6<(%)D0Y(78w@%`8P$BdAl!h?U@>ivr%*=CAo zvQgXaMOq|U2UnE}YJ&#`4-zSYBG-+Hq*YlbDhod6&2><#YORveL{mD_L63w^Ve8vq z)?`OGkOvFI;9(a11{i#QJUqnl_x)nL$hQ2DDIL<@)>(1&jVKqg|2$n?S7o-6d0Od} z&dW;jbppWYdGzk`{Os)Y> zpTMCZ4TaXj_l53I1#7Gw+~_!p?!HbwWx+su>{+Wb6?Au@f#63$!P2ZKw0kR;P4DEg zZX1QXdZ$(Zg-khcGmsHIm>FjHqc}4YL^O7VFdrp7m`FOz+{>Db^TI7iLeFj z9!}^_5~Fa2bCfVr&if=yX!`m-SEo70uN=W6+ literal 0 HcmV?d00001 diff --git a/CONTROLLER/__pycache__/program.cpython-36.pyc b/CONTROLLER/__pycache__/program.cpython-36.pyc index 991ce380ac83bceca1e19ad7c105b76968a708e9..6891bae24b5b1fd4ac38876b082c971610724f19 100644 GIT binary patch delta 581 zcmaJ;Jxjwt7{2S}<7|zsRjdxWNYSV`=%yl0et?^uf)ZlxYzs+KF3lhm9Tc3~8=T$r zAM|gyIAjqK!9U<`?oy0M@s4}m2kv>F=RQ74FGg+CF!EP}&$CknfOqg~poH%wE8Iwc z00KQwODi1KoUAzyS?B-|M3h@Vl$)HT^p2O{VXt$foB(sO_uQYe3a!XLr_7E*%1jt5 zA@wev0K>csx1r7l@L^F;Vi^8`v4q72b6O9JOuk+&m69P&CrUlFhs0f%9kQqrP+?e<)HCdtP z!cc)&!)h`$j4_hCrW$J^lCrpvR=e)_)Y8%yW@Tw3zIs$ZjCcHiL>}FRB1Hsan9gst CM|Il( delta 941 zcmaJ}v4ph%TvvZl4CsKotX8VuHV-sH zzK~->0sk(1$vOZhoCaj0uvA(WumQVIxWd&v!qr_iQ05z#==1sXVVk%1$e_kg@@24f z-hM{x&iv#4YF>-R;R{bV%>@Il6O|*Vf|r}Zjd&b7 z!|m7~di5-2`&SyUVN}4O+c)e6#dh#taiqpnJ z&svw7*$=Hhs{v)vL}(#&5KbekBAh`ui*OF1OesCgEAWA!@T3i3P?Z|Gp}|z8H4H^Y lK&SPhB?G;9!(tgvU&rH%^5(|vFy`aHyF)QKw%DLJe*)1;&f@?8 diff --git a/CONTROLLER/main.py b/CONTROLLER/main.py index d045f96..bbffb0f 100644 --- a/CONTROLLER/main.py +++ b/CONTROLLER/main.py @@ -17,7 +17,7 @@ game.add_list_choice() #method for clear game.clear_terminal() -# -game.player_entry() -game.add_user_list() +player_game = Player_entry() +player_game.player_entry() +player_game.add_user_list() game.compare_list() \ No newline at end of file diff --git a/CONTROLLER/player_game.py b/CONTROLLER/player_game.py new file mode 100644 index 0000000..b278aa3 --- /dev/null +++ b/CONTROLLER/player_game.py @@ -0,0 +1,16 @@ +class Player_entry: + """class for player entry and list for compare with program list""" + def __init__(self): + self.player_list = [] + self.player_numbers = 0 + + def player_entry(self): + """save number entry user """ + player_numbers = int(input("enter numbers ......")) + self.player_numbers = player_numbers + print(player_numbers) + + def add_user_list(self): + """save in list number entry user""" + self.player_list.append(self.player_numbers) + print(self.player_list) \ No newline at end of file diff --git a/CONTROLLER/program.py b/CONTROLLER/program.py index 6dee919..d4e5866 100644 --- a/CONTROLLER/program.py +++ b/CONTROLLER/program.py @@ -1,4 +1,5 @@ from player import * +from player_game import * from random import * import os class Program: @@ -23,16 +24,7 @@ def clear_terminal(self): """method for clear prompt after disaplay number""" os.system("clear") - def player_entry(self): - """save number entry user """ - number_user = int(input("enter numbers ......")) - self.number_user = number_user - print(number_user) - def add_user_list(self): - """save in list number entry user""" - self.user_list.append(self.number_user) - print(self.user_list) def compare_list(self): """compare list user and list program """ From 3a53e011b324be3f4fc4fc89112547eccf0485b5 Mon Sep 17 00:00:00 2001 From: nicos Date: Thu, 5 Dec 2019 13:34:26 +0100 Subject: [PATCH 08/29] import sleep method for terminal and write method for compare list --- CONTROLLER/__pycache__/player.cpython-36.pyc | Bin 1034 -> 1049 bytes .../__pycache__/player_game.cpython-36.pyc | Bin 959 -> 985 bytes CONTROLLER/__pycache__/program.cpython-36.pyc | Bin 1750 -> 1792 bytes CONTROLLER/main.py | 10 +++++++-- CONTROLLER/player.py | 10 ++++----- CONTROLLER/player_game.py | 20 ++++++++++++++++-- CONTROLLER/program.py | 12 ++++++----- 7 files changed, 38 insertions(+), 14 deletions(-) diff --git a/CONTROLLER/__pycache__/player.cpython-36.pyc b/CONTROLLER/__pycache__/player.cpython-36.pyc index bc33554e4d3bd5808b9d7c58e99e19c0d40fd2f8..6b18394a05df7e08aa3ca5a899cf98e182fdd0e8 100644 GIT binary patch delta 314 zcmeC;n90Fu%*)HA_~=FK`H7rcL>Oxr;u%sHfFxrILokCTliw|diRYyl*(Scqt5;%R zU?^coVQglsWvpRLVajGI5=mhOv9lPPL3)_LdRY9bgi`ZLQi~KS^Gk~q@)C1X6%?$B zn1H&YSlvDRgF`f#Z?R_P6_l3TVl6EwNG&R22FhtN6|n*-FuRBi!~zrSK-MiTkRg*# zF$%JBFmf=mOn$&PpOI;D15=L%NM{iXNDXU2QD$BV%oLCivMG~In6utGyy_N delta 290 zcmbQq(Z#`O%*)GV$o(Sr)I`oLLJTzw@eC;-k}-uLm_d`#Z{kHMM%IaM@-kHz7#LC* zYZ)svPY~c(wjBq{7ezzE^MD+CZQu9huixevJON$ip5_3}( ztTdT!v1aBKl$I1R0S(h+Dq;arV0IBJhy^CtCSPEbVr60EV&s|po^d`S$K-yd9u1I& zB4!|Qi?yIAGp_`u86z5F#`Z%S2~vf diff --git a/CONTROLLER/__pycache__/player_game.cpython-36.pyc b/CONTROLLER/__pycache__/player_game.cpython-36.pyc index df013c54c8b8cb954baced6a13eea85551fa2db5..eab52d65c9ec374ecad5b3d81f4b4055b895ebd2 100644 GIT binary patch delta 472 zcmZvYJxjwt7{{OIE-$CFx^-~sA{fD`gD9ecU>9{!90VzW3)+&V;c`I==@h>}$>xW# zpTk=mT=WwNPCj>_6fwv1zvm_QzhANlU&6CqyS@7Q`F<-nz#A+*RKqbvu|Xn1VhUH# z2gxLV1j%c5gVMW%$p4@@L}+k(zW>Y=&cAjrY_{+Sz2+YGIvpBo&?vE{HNy%k7_er6 zyM1o>Fw@2#W_hWVZ+(~wXmhy=ZRSK!W?Fd~PZKprGOea7)G0g?V6EnqZT6T=DNZPg zE=dI=7|~rLRwKGHcza39eK*ym>|ycB$MuDFF8atZ**?CD-rKMUJFViH(MUp=uqC}}#Q&Ws0t4+jK93R90 y?W#N}0;+Y$G+_GK{{DyNoQ#^a0Xi5sf!9x`WXdo9t#!fv<&|oR^q}7*6?_3pElwT) diff --git a/CONTROLLER/__pycache__/program.cpython-36.pyc b/CONTROLLER/__pycache__/program.cpython-36.pyc index 6891bae24b5b1fd4ac38876b082c971610724f19..41f727a574a9f975a92f9f3a4ee501aca18a9c8f 100644 GIT binary patch delta 483 zcmY+BJ4*vW5P)~~aoI#KC>k&ki9tawjfG$*L@exLVL&(#3GN~4C5F9g1W_RtHVU$h z|3T2gU*HcAJCU?Drm(kkCPC4G`DS;X`*`)w^Jh!GpYy*ywofHv@9d8VT-Q*OWrSe{ zV%8wbV+aAQhTc!CXqoy92j<+9yn+R{p)R57-qhCFI0kKjFhwX5N(B8MS=!>uGrC$bhR`5E vds^uXQfo1Y243jdX4@RK>;&e7GTm=QmVW5>TzgIQP$wGU?z{y#3L3rvS3y=( delta 393 zcmYk2y-EW?5XWcsD~sl$h?f&g3KhW%VxcdPPAyEMAOydH8w5?F>;*v(6=GqbMc4ct9%s+=qilxe-w|~LNlqr)nLihd+)29t=A{N{W zn^p#CmbouBBP+46!j19J#e6YC?*m{tx5pnbayc>A?T3X~s$IgdPds5Z-)06oh|tn) z<_<(T;#N|N^}{wG#Aq`l?o|}CMKXyZ0L!|bc))pgF7I%`_2qUrPGvjkk@tu^rrf)V z)~){;zcuka8U<>lB^{-;=7ZZ)v DOB6`k diff --git a/CONTROLLER/main.py b/CONTROLLER/main.py index bbffb0f..8dfed6d 100644 --- a/CONTROLLER/main.py +++ b/CONTROLLER/main.py @@ -1,7 +1,8 @@ #! /usr/bin/env python3 # coding: utf-8 from player import * -from program import* +from program import * +from player_game import * if __name__ == "__main__": print("Hello start game") @@ -20,4 +21,9 @@ player_game = Player_entry() player_game.player_entry() player_game.add_user_list() -game.compare_list() \ No newline at end of file +print(Player_entry) +print(player_game.__dict__) + +game.compare_list(player_game.player_list) + +#compare.compare_list() \ No newline at end of file diff --git a/CONTROLLER/player.py b/CONTROLLER/player.py index c9a5c6d..967fc84 100644 --- a/CONTROLLER/player.py +++ b/CONTROLLER/player.py @@ -1,15 +1,15 @@ class Player: """method for initialyse name""" def __init__(self): - self.name = None + self.name = "" self.level = None """method for ask and save name entry""" def name_entry(self): - name = "" - while name == "": - name = input("...enter your name :") - self.name = name + name = input("enter your name :") + if name == "": + name = "GHOST" + self.name = name.upper() def level_choice(self): """method for user choice level""" diff --git a/CONTROLLER/player_game.py b/CONTROLLER/player_game.py index b278aa3..48ed82f 100644 --- a/CONTROLLER/player_game.py +++ b/CONTROLLER/player_game.py @@ -1,16 +1,32 @@ +from program import * class Player_entry: """class for player entry and list for compare with program list""" def __init__(self): self.player_list = [] self.player_numbers = 0 + def player_entry(self): """save number entry user """ player_numbers = int(input("enter numbers ......")) self.player_numbers = player_numbers - print(player_numbers) + #print(player_numbers) def add_user_list(self): """save in list number entry user""" + self.player_list.append(self.player_numbers) - print(self.player_list) \ No newline at end of file + #print(self.player_list) + + player_list = self.player_list + print(player_list) + + return player_list + #Program.compare_list(Program, self.player_list) + + + + + + + \ No newline at end of file diff --git a/CONTROLLER/program.py b/CONTROLLER/program.py index d4e5866..4144d8e 100644 --- a/CONTROLLER/program.py +++ b/CONTROLLER/program.py @@ -1,7 +1,7 @@ -from player import * -from player_game import * from random import * import os +from time import sleep +from player_game import * class Program: """class for program controller """ def __init__(self): @@ -9,7 +9,7 @@ def __init__(self): self.user_list = [] self.numbers_program = None self.number_user = 0 - + def random_choice(self): """method for choice random number """ self.numbers_program = randrange(1, 100) @@ -19,6 +19,8 @@ def add_list_choice(self): """add to empty list number choice""" self.program_list.append(self.numbers_program) print(self.program_list) + sleep(2) + def clear_terminal(self): """method for clear prompt after disaplay number""" @@ -26,9 +28,9 @@ def clear_terminal(self): - def compare_list(self): + def compare_list(self, player_list): """compare list user and list program """ - if self.user_list == self.program_list: + if player_list == self.program_list: print("True") else: print("false") From ddef42242064089a8289f3ae143625576922b09a Mon Sep 17 00:00:00 2001 From: nicos Date: Thu, 5 Dec 2019 14:22:32 +0100 Subject: [PATCH 09/29] add three level to random method progam numbers --- CONTROLLER/__pycache__/player.cpython-36.pyc | Bin 1049 -> 1039 bytes .../__pycache__/player_game.cpython-36.pyc | Bin 985 -> 985 bytes CONTROLLER/__pycache__/program.cpython-36.pyc | Bin 1792 -> 2073 bytes CONTROLLER/main.py | 4 +-- CONTROLLER/player.py | 5 ++-- CONTROLLER/player_game.py | 10 ++----- CONTROLLER/program.py | 27 ++++++++++++------ 7 files changed, 26 insertions(+), 20 deletions(-) diff --git a/CONTROLLER/__pycache__/player.cpython-36.pyc b/CONTROLLER/__pycache__/player.cpython-36.pyc index 6b18394a05df7e08aa3ca5a899cf98e182fdd0e8..0a26b0544e4b9bc93b7d418c6cd6c9dc7c6aa4cc 100644 GIT binary patch delta 105 zcmbQq(a*tY%*)H=!1yxu@kUMoCPs(JQcR`-CCoL9&5Sh+@hmlr!3>)0lk=HoOKP$e zaWXJ4++s`1FUn0UDPjh3m^1TACd)Hh@$&$A3`{JHQj8*uT#PJ})0hJpg(kme7N2~c G*$V&=5*NMz delta 111 zcmeC@n90Fu%*)HA_~=FK`Hh?cOpF1OrI<_=Y8Y!6;+acWQrNP9tSlxVW^QI`W@KbY zVGm}|z#VquhG6k%kW9K#&Q KC^&f?b0Pq{aTo0X diff --git a/CONTROLLER/__pycache__/player_game.cpython-36.pyc b/CONTROLLER/__pycache__/player_game.cpython-36.pyc index eab52d65c9ec374ecad5b3d81f4b4055b895ebd2..a2ccc96f0b762cf0d06f4ffb0c78d44b28424e2a 100644 GIT binary patch delta 55 zcmcb~ev_Tcn3tF9?C%$`Gnh7V88R_)OtxVFke z=q3~h^9e5f85a%i++^W5=)IMUfe;hw)UCRw>)hA-%GsuOzg+gdTC*3=-KqDEwx^$- z`C{uM>6FCw0SPWle>C^66GD1qOu{)*fi@Eq&@#3y2yj_TQD6p+Zqi3razByBG6}mc zhjCX1G`CZk9DXCJs6Wsrdmb zDKS#C6);r*Z|;m#Jjme0&BF#-JHZt35Y zPsU)OwxF+=x|31CgmucW0GS2%3}eb{VRpl_f!8)XXARFrzTq+8y)is@4Ud{!3kMbn zxURAr6AR*)VOTSPz!0!LGfc4+IHnw(qKXCrR!=Gy?v;;#p9a)aXtgwDB!lk_w=zNZY^(@mKiD!b;76@#e)a>k5i+*uDOk*gfZio zsVc%HgsTWOglhazas)*EXc W%K78|P`plL6XzwxGID6859=@QqQ?jT delta 713 zcmZ`$&ui2`6rPt%er&qg?ka+nwpwhF>|rSgdK1Bm1z7}pT97a#agAh?_>vwfQVP8& zo|ZZF;2+@M;mto`51#F*SHX+#C54D+!hG}IydU59X3mGF1Mj}?d;ZTKFHhvsJAtRm zj|cLF2u92Ak6=@8!B(Fe?zF6EDRlhzYj)h&Wr#1I>2#(NP$P51`R07PsOqtu(`-9xUphzX{FIqRXy zV_NeBZ8}<6C8l{D06OF$YiOazL7$V0MHsy<(kSuisFDQ2=X;oiIxkjlKR|;bQ z9_Y97)9$|p7(`j3Fsu_?q`AsA^d0N`0h0wrGw^Dy%+zs$P4B;_??=U=RG2iu+xpTf z#@+pNR&!J9EzwbR)$5-AV8?r1QfD>k9@B3wICc%%#m3?qgc3^y4z z82GXO(Ac!(Zpd%KcUlbzT#(?}uH`y}u4^{Yz@FLdTjF*7&Dj}tdfGPnm$UsFx7dtR diff --git a/CONTROLLER/main.py b/CONTROLLER/main.py index 8dfed6d..aaf97ea 100644 --- a/CONTROLLER/main.py +++ b/CONTROLLER/main.py @@ -12,6 +12,8 @@ #ask method level choice for user select level player.level_choice() game = Program() +#ask method to use level in program +game.get_level(player.level) #ask method random number game.random_choice() #ask method for save number in list @@ -23,7 +25,5 @@ player_game.add_user_list() print(Player_entry) print(player_game.__dict__) - game.compare_list(player_game.player_list) -#compare.compare_list() \ No newline at end of file diff --git a/CONTROLLER/player.py b/CONTROLLER/player.py index 967fc84..2ac89c3 100644 --- a/CONTROLLER/player.py +++ b/CONTROLLER/player.py @@ -16,5 +16,6 @@ def level_choice(self): level = "" while level != "1" and level != "2" and level != "3": level = input("...{} enter number of difficulty choice\n 1:easy 2:midle 3:hard\n".format(self.name)) - self.level = level - print("{} you choice level {} start game ..........".format(self.name, self.level)) + self.level = int(level) + return level + print("{} you choice level {} start game ..........".format(self.name,level)) diff --git a/CONTROLLER/player_game.py b/CONTROLLER/player_game.py index 48ed82f..cb93282 100644 --- a/CONTROLLER/player_game.py +++ b/CONTROLLER/player_game.py @@ -5,24 +5,18 @@ def __init__(self): self.player_list = [] self.player_numbers = 0 - def player_entry(self): """save number entry user """ player_numbers = int(input("enter numbers ......")) self.player_numbers = player_numbers - #print(player_numbers) - + def add_user_list(self): """save in list number entry user""" - self.player_list.append(self.player_numbers) - #print(self.player_list) - player_list = self.player_list print(player_list) - return player_list - #Program.compare_list(Program, self.player_list) + diff --git a/CONTROLLER/program.py b/CONTROLLER/program.py index 4144d8e..cf3eb07 100644 --- a/CONTROLLER/program.py +++ b/CONTROLLER/program.py @@ -9,25 +9,37 @@ def __init__(self): self.user_list = [] self.numbers_program = None self.number_user = 0 + self.level_choice = None + + def get_level(self, level): + self.level_choice = level + print(self.level_choice) def random_choice(self): """method for choice random number """ - self.numbers_program = randrange(1, 100) - print(self.numbers_program) + if self.level_choice == 3: + self.numbers_program = randrange(1, 100) + print(self.numbers_program) + sleep(1) + if self.level_choice == 2: + self.numbers_program = randrange(1, 20) + print(self.numbers_program) + sleep(2) + if self.level_choice == 1: + self.numbers_program = randrange(1, 10) + print(self.numbers_program) + sleep(3) def add_list_choice(self): """add to empty list number choice""" self.program_list.append(self.numbers_program) - print(self.program_list) - sleep(2) + #print(self.program_list) + - def clear_terminal(self): """method for clear prompt after disaplay number""" os.system("clear") - - def compare_list(self, player_list): """compare list user and list program """ if player_list == self.program_list: @@ -35,7 +47,6 @@ def compare_list(self, player_list): else: print("false") - def clear_user_list(): """clear user list number for again manche""" From 107b6f847bfa8c439c5ddcd52e0c618453964cc5 Mon Sep 17 00:00:00 2001 From: nicos Date: Thu, 5 Dec 2019 14:54:27 +0100 Subject: [PATCH 10/29] write #mesages in main.py and program class --- CONTROLLER/main.py | 6 +++++- CONTROLLER/program.py | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CONTROLLER/main.py b/CONTROLLER/main.py index aaf97ea..7a6c6d0 100644 --- a/CONTROLLER/main.py +++ b/CONTROLLER/main.py @@ -18,12 +18,16 @@ game.random_choice() #ask method for save number in list game.add_list_choice() -#method for clear +#method for clear prompt game.clear_terminal() player_game = Player_entry() +#ask method for player entry number player_game.player_entry() +#method for add to list number of user entry player_game.add_user_list() + print(Player_entry) print(player_game.__dict__) +#method for compare list player and program list game.compare_list(player_game.player_list) diff --git a/CONTROLLER/program.py b/CONTROLLER/program.py index cf3eb07..ebde9fa 100644 --- a/CONTROLLER/program.py +++ b/CONTROLLER/program.py @@ -12,22 +12,29 @@ def __init__(self): self.level_choice = None def get_level(self, level): + """method for save level choice user""" self.level_choice = level print(self.level_choice) def random_choice(self): """method for choice random number """ if self.level_choice == 3: + #select number betwen 1 and 100 self.numbers_program = randrange(1, 100) print(self.numbers_program) + #timer for clear prompt after 1 sec with clear method sleep(1) if self.level_choice == 2: + #select number betwen 1 and 20 self.numbers_program = randrange(1, 20) print(self.numbers_program) + #timer for clear prompt after 2 sec with clear method sleep(2) if self.level_choice == 1: + #select number between 1 and 10 self.numbers_program = randrange(1, 10) print(self.numbers_program) + #timer for clear prompt after 3 sec with clear method sleep(3) def add_list_choice(self): @@ -35,9 +42,8 @@ def add_list_choice(self): self.program_list.append(self.numbers_program) #print(self.program_list) - def clear_terminal(self): - """method for clear prompt after disaplay number""" + """method for clear prompt after display number""" os.system("clear") def compare_list(self, player_list): From 425450793bc7bd0f93564dea8f5d4f99ecda4b28 Mon Sep 17 00:00:00 2001 From: nicos Date: Thu, 5 Dec 2019 16:12:08 +0100 Subject: [PATCH 11/29] work in progress in loops for game and compare list --- CONTROLLER/__pycache__/program.cpython-36.pyc | Bin 2073 -> 2384 bytes CONTROLLER/main.py | 47 +++++++++++------- CONTROLLER/program.py | 33 ++++++++++-- 3 files changed, 59 insertions(+), 21 deletions(-) diff --git a/CONTROLLER/__pycache__/program.cpython-36.pyc b/CONTROLLER/__pycache__/program.cpython-36.pyc index 01c1944d6c2e3cbb6304fc13f7ae2c05eb080994..2de546beb41ae29fcb6872260c2b3a90551b1e3a 100644 GIT binary patch delta 713 zcmYjPPiqrF6rY)$Nw%95YP2;yL?(JLY5h}ZKnQpciyqWiP!IxTT{C04X0sb-C$$L) zJ>(+2&Z$?A-bBzZ;KiHXWbq65Aq3xS4~FIa=KcA-H}AdKv$Y=;Z+CUo`&j#P@Z0<3 zT_Fwp3^mELK9u?}5&U(ccp4l@9?2sa@!nw)_9P#tQkk3NPH7Dxlu`ghJ}0Dw>+9B0 z%^e;oV~@BX%cuF~e85|#PdoUA`9kaF7k!9t8_u>*7^K-+_ic@r02&5*zYN3}H4 zxQYbHbt0Svp2JQcM%0dW1RW5Vk?e!OWDF)NnD2%9N#;ysnvpn}Zi|FZk}-c5#G31b z+xB_T55kzsSWCr$$lC|sXsj(E4u;bAo49+y#{E3( zpZ^|e1$wt|4=E4S%==I2fSp<=A{*F+&m+^yzDoKk7~WcEZDEx!5()TgaZ delta 371 zcmYk1y-Nc@5XE;kcYEvJMI{PGgqRc}F=$~7RyJDLg@9H;IaYIqXujNwg_6!Lg`fk1 zt-Xc#kEAt~omeQ=R?eo;Vt(_OH*eS-rXHqMF_~2NiI2kr@vJi3WqT|SSmB%gBx5Xg z2n=5C_y*)sc96CMt{?yflInlQ_rxRQaNv|-6tmC}5f=?oiw_X-M#X?EhbD^&5M!RGK zcK<3>F`c^6t+hY1oDW7a4BNUDg(05HEk8q>X3-*x-(n7ja>n Date: Fri, 6 Dec 2019 09:51:03 +0100 Subject: [PATCH 12/29] change clear method for clear prompt --- CONTROLLER/__pycache__/player.cpython-36.pyc | Bin 1039 -> 1039 bytes .../__pycache__/player_game.cpython-36.pyc | Bin 985 -> 968 bytes CONTROLLER/__pycache__/program.cpython-36.pyc | Bin 2384 -> 2479 bytes CONTROLLER/main.py | 6 +- CONTROLLER/player_game.py | 3 +- CONTROLLER/program.py | 63 +++++++++--------- 6 files changed, 35 insertions(+), 37 deletions(-) diff --git a/CONTROLLER/__pycache__/player.cpython-36.pyc b/CONTROLLER/__pycache__/player.cpython-36.pyc index 0a26b0544e4b9bc93b7d418c6cd6c9dc7c6aa4cc..4ac1ef771570729cafcd8771530e0f0d49a75acd 100644 GIT binary patch delta 15 WcmeC@=;vTF=H=xQl-tP0$pQcu&H{e` delta 15 WcmeC@=;vTF=H=ybVBE;Y$pQcvR|1g$ diff --git a/CONTROLLER/__pycache__/player_game.cpython-36.pyc b/CONTROLLER/__pycache__/player_game.cpython-36.pyc index a2ccc96f0b762cf0d06f4ffb0c78d44b28424e2a..acbea6cd493dd4e77dccb60ddc4a0a15514fa147 100644 GIT binary patch delta 92 zcmcb~euACTn3tF9s?e+0T^l(Im?R_^7#M08vKX=$fh1EiBO{ns%Q$%^le#c-5ercI o7F%LLL26z~5i5{0`4*Et7aNelz|6JiaxQZY02fmfZU6uP delta 109 zcmX@Xev_Tkn3tF9?C%$`Gd6M-FexZ7Ffi0GWHDqh0!gN3Mn*8Nma&Anh7rV@JdsIV zilvAJsO%P7VnIP_UP=)wh{IY?l$lpD`81P04+oIXz{JPM#>l}qnT0u=k$-Xwa}EFs CJsFz- diff --git a/CONTROLLER/__pycache__/program.cpython-36.pyc b/CONTROLLER/__pycache__/program.cpython-36.pyc index 2de546beb41ae29fcb6872260c2b3a90551b1e3a..23303c2e5198693e6b696fc247e353caec75ff4d 100644 GIT binary patch delta 785 zcmZ`%J#5oJ6u$TF?4I*So0e3FQq&?vjT&_!MQX>kiVy;p4v{KFQK+qw;H2rq(`+4tfv6vfN|JnZX z!ONkSV~iz`u#T=`-32v6-@1cq`D;WXBw(mtVXfIDmasna;Tft*3_kjNf)q$bsvxy) zRp%cSN!_uko2hz>-=E_)%Ymo5L!ay@&~34#Kk?H1f=ODiNpo00WBLbw3#jjoG-=WD0QRr zC=LcSRMJS$Qy%#Y%+S)3{Zl6n)Sx%)hE>v{WdepdD1fB5G-ZWLDnUPVHg@)Cn-60= z+m6Y{H2*%eYJ$|j>X@6agx@gtf{;$#@Np~>vCn*-`ICzN?%dntsblAt@-P_MW7M3i z-25o)o(HNE_M-Se9v%-yad4{CP0FjA?)u_3k;pWJ2>}%-gFwLr=$G!|Eif`YX55C` zahoO_u`%e+?xr_win^_TyLa*rXlZ&=Kd#KI06fyWvNc;IS(yu^Dh8JHJGqsY(vc-8 L?}|h@iy%vM zG)zx{QbaTe@e}w1)F%pBYW@JTYauAI(!AZBc{{W7=JUe$`M8&+$*1 Date: Fri, 6 Dec 2019 10:39:30 +0100 Subject: [PATCH 13/29] modify display elem in program list --- CONTROLLER/__pycache__/player.cpython-36.pyc | Bin 1039 -> 1162 bytes .../__pycache__/player_game.cpython-36.pyc | Bin 968 -> 969 bytes CONTROLLER/__pycache__/program.cpython-36.pyc | Bin 2479 -> 2506 bytes CONTROLLER/main.py | 2 +- CONTROLLER/player.py | 7 +++++- CONTROLLER/player_game.py | 2 +- CONTROLLER/program.py | 20 ++++++++---------- 7 files changed, 17 insertions(+), 14 deletions(-) diff --git a/CONTROLLER/__pycache__/player.cpython-36.pyc b/CONTROLLER/__pycache__/player.cpython-36.pyc index 4ac1ef771570729cafcd8771530e0f0d49a75acd..e3c6f310d4fc4dd81ee04f020785f373eef6fefc 100644 GIT binary patch delta 491 zcmZutJxc>Y5Z&3^z3iO{h=@omv{Fv&tPG-d>1^x{LkQUw6Yg?x_Y{MH6ekEa60Y)R z_;;=ntRnshcNY9WT$nd+hBsgPBp!p#exniIZoPLNJVM^cuV-U&V$Ez@kVHa4V)QhD zl*SZDn@CTxdm>puV^6{viTJ{5$!P=?H;Gc?dFutl{G$cD+<_}#bu?d5KExsHi zNwqH#^wqmYT9X4c7A~ra|4rJZp%1g{mjZe)hDXQd{ z%*);pv!&%1$3Dm~|5@szZ z0k%ZOU;Q-&dAS9PUQnCDCPkY3`{JHQj8*uT#PJ}k1)IEaDa4jg9wl} zk<0))8|305Mj!#g#UQmDj4X^CtQ>4$Q9n&aFpW*yEe@O9{FKt1R6DRIGa2USJj;z#HhwnnZjp?4qmwqWkNruG{QW*3LIKC(ip`*YED^qJFM3#%5^; z_vEUq%p~k+IC(rm8s^w~t_GndwKA{51sSkVm%JWD*^qjy4l=6^QV<#bONu|_(#$8y z3BCD)8o!D*ihmcqTxHT+VUDE|B0v5P1x(QoBC+XvE@BJmQ(ic$EjuQfl%S}e?qjJE zM#k12?z+kq3#}=zAf+WB2|tv26y2SifOy3d`kK--CF)HKX2+yf)2iAEle`fRGAeIO z6!b`-TiNy^?t7JbQS2nf(b1w1HSPQEiH940DF~w^dcmO|){_8x;-{~T{!E$#<86=u zos4lE)Qb^7pDLOIF#m954g)NzD{BZG^=wV0d+9n3#4Z=RAyu>6)u`Rmk+L|(ojb;w QK~2fMUF@PXQqo@h02ncFy#N3J delta 515 zcmZ{g&r1S96vyYy&aSJen35Gqkp*f&1WK2VN(UpUJP3lw;x4A``s3{iC5i|Cf|zTE z{)33l9Xr&Y;9n5^2i=-ogCcO?z3+E;^Lg`T-eZq3e>M~fSSz2kw=hh;sgzoSerK*UT O^sa^LVq4`C|LHgL&v4-Y diff --git a/CONTROLLER/main.py b/CONTROLLER/main.py index bccbd6a..2204d26 100644 --- a/CONTROLLER/main.py +++ b/CONTROLLER/main.py @@ -32,7 +32,7 @@ #print(Player_entry) #print(player_game.__dict__) #method for compare list player and program list - game.compare_list(player_game.player_list) + game.compare_list(player_game.player_list, result_lists) game.clear_user_list() if result_lists == False: diff --git a/CONTROLLER/player.py b/CONTROLLER/player.py index 2ac89c3..c154f8f 100644 --- a/CONTROLLER/player.py +++ b/CONTROLLER/player.py @@ -1,3 +1,5 @@ +import os +from time import sleep class Player: """method for initialyse name""" def __init__(self): @@ -17,5 +19,8 @@ def level_choice(self): while level != "1" and level != "2" and level != "3": level = input("...{} enter number of difficulty choice\n 1:easy 2:midle 3:hard\n".format(self.name)) self.level = int(level) - return level print("{} you choice level {} start game ..........".format(self.name,level)) + sleep(2) + os.system("clear") + return level + #print("{} you choice level {} start game ..........".format(self.name,level)) diff --git a/CONTROLLER/player_game.py b/CONTROLLER/player_game.py index 3963cff..810b246 100644 --- a/CONTROLLER/player_game.py +++ b/CONTROLLER/player_game.py @@ -7,7 +7,7 @@ def __init__(self): def player_entry(self): """save number entry user """ - player_numbers = int(input("enter numbers ......")) + player_numbers = int(input("enter numbers ......:")) self.player_numbers = player_numbers def add_user_list(self): diff --git a/CONTROLLER/program.py b/CONTROLLER/program.py index 4a17c0e..2a923b0 100644 --- a/CONTROLLER/program.py +++ b/CONTROLLER/program.py @@ -39,37 +39,35 @@ def clear_terminal(self): """method for clear prompt after display number""" if self.level_choice == 1: for i in self.program_list: - print(i) + print(">".format(i)) sleep(3) os.system("clear") if self.level_choice == 2: for i in self.program_list: - print(i) + print(">".format(i)) sleep(2) os.system("clear") if self.level_choice == 3: for i in self.program_list: - print(i) + print(">{}".format(i)) sleep(1) os.system("clear") - def compare_list(self, player_list): + def compare_list(self, player_list, result_lists): """compare list user and list program """ - #print(player_list) - #print(self.program_list) - compteur = 0 + for i in range(0, len(self.program_list)): - if self.program_list[i] ==player_list[i]: + if self.program_list[i] == player_list[i]: result_lists = True - #print(result_lists) return result_lists + print(result_lists) else: result_lists = False return result_lists - #print(result_lists) + print(result_lists) def clear_user_list(self): """clear user list number for again manche""" @@ -84,4 +82,4 @@ def play_again(): break - \ No newline at end of file + \ No newline at end of file From 0a5422bbe9bbfcce6756c6779e262dfb4c55a553 Mon Sep 17 00:00:00 2001 From: nicos Date: Fri, 6 Dec 2019 11:09:01 +0100 Subject: [PATCH 14/29] start modify compare methode --- CONTROLLER/__pycache__/program.cpython-36.pyc | Bin 2506 -> 2504 bytes CONTROLLER/program.py | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTROLLER/__pycache__/program.cpython-36.pyc b/CONTROLLER/__pycache__/program.cpython-36.pyc index bc4a4ac096812a9d6eac94598b9af881748e1a43..56cba415784d8acd43876430922d6ad8489a6092 100644 GIT binary patch delta 117 zcmX>ld_tJhn3tF9t@5kb9UD2{uuR^~!Z(?jRfLr-m_d_$vJ9)ScomDCLUnBs9|Hr! zE!O0m)Wo79K_Gi`2CESxqr~LdY-)@$lMk`2VpQ0i%U;FEs4@8khqZt#P)U&zh)@O* Qnv;z=-5I4OS9AIU099}uL;wH) delta 117 zcmX>hd`g(pn3tEUUh!4z#*LhBSQyzRe`8T(We;Z1?lEQyv|P diff --git a/CONTROLLER/program.py b/CONTROLLER/program.py index 2a923b0..4f045bb 100644 --- a/CONTROLLER/program.py +++ b/CONTROLLER/program.py @@ -39,19 +39,19 @@ def clear_terminal(self): """method for clear prompt after display number""" if self.level_choice == 1: for i in self.program_list: - print(">".format(i)) + print("> {}".format(i)) sleep(3) os.system("clear") if self.level_choice == 2: for i in self.program_list: - print(">".format(i)) + print("> {}".format(i)) sleep(2) os.system("clear") if self.level_choice == 3: for i in self.program_list: - print(">{}".format(i)) + print("> {}".format(i)) sleep(1) os.system("clear") From eb5688b67d6674819c769186b439428c2b4c12b1 Mon Sep 17 00:00:00 2001 From: nicos Date: Fri, 6 Dec 2019 16:03:38 +0100 Subject: [PATCH 15/29] change method compare --- CONTROLLER/__pycache__/player.cpython-36.pyc | Bin 1162 -> 1217 bytes .../__pycache__/player_game.cpython-36.pyc | Bin 969 -> 765 bytes CONTROLLER/__pycache__/program.cpython-36.pyc | Bin 2504 -> 2310 bytes CONTROLLER/main.py | 41 ++++++++---------- CONTROLLER/player.py | 15 +++++-- CONTROLLER/player_game.py | 15 +++---- CONTROLLER/program.py | 36 ++++++--------- 7 files changed, 48 insertions(+), 59 deletions(-) diff --git a/CONTROLLER/__pycache__/player.cpython-36.pyc b/CONTROLLER/__pycache__/player.cpython-36.pyc index e3c6f310d4fc4dd81ee04f020785f373eef6fefc..139f25973508ce0ca74cea4c8244712ab305e384 100644 GIT binary patch delta 491 zcmY*VJx{|h5WTaLGz}?545$K$6$K#{HiQrxTN%m}sYIc6X_3=ZPK#6t!9b^OD8GV% zg_#8geuP&h_!XQpRK?c4d%C;#{IRHi)NhX(jo_{S+nqZA->|Yc@iU6zkU)Sy1+mRc zVa8&HmUG1~;T(h`+&KvMiN%h<4n*D$X`mgUaSJ8omnxpAI>U!FQ!592cds(5 zEqyA-$}Fs|n)C+wuqQXmSAO*v+OejE?f-(MO4FBvjl!0EbkO%`Z&dZj)h(*V&SaQL k&4`-XSm!r7&8q&&bC!n2Kgn`2Rq_;p-cfyuk0JW_2Vu@(j{pDw delta 482 zcmZ8d%Sr<=6wS>f<8*AHD{<*cn1w3^K}6iOtGcMGfm%wF(veJONTy=J$3j8qPUb88 z4E+fqTUWaB6U+@*s)3xGoSbuSlGnzvG1zal;_IES!BarU2U#0#Pfp!5yAA{qph$`< zRglw^0_hMD2=+(>d!T6`pidJ1>Aa+ufaOL>Sw3Ih9kekHH)QC-4nYuSq&@4vve_t? zmMeKBl?yQ=)#Qcfs6K?Fn7g21Sg^i@X%|__JKeMXc@kKj&B}RY`MfNp)@V(r-f)ZO zIzr~5;h2rF&rr@Py@=~Q`Ub52rpv)5o`sV_=cCH!Y>+umh%zrVa*CW5#)f8LDw+Rw zLC^m#P5+MJcv@s**{i+eFStMumyViY&nln(PxNG%`j_7GhLqWSeZo*w0qO2oz|0_ mkQN{YYvy2NVdP)|i}`6X-C{2&%1S5Z>7|$)+^DX+=cSlg*_Ey@-e?-izQ#K}y=qA*GFFHxU|IMD*ZILSDf4 z5WM>ec?91j;0UaB$7)-XZ8>}aoB*0ienjFb5O} z*>)u`ioJ29lfOcJL(z!R3Z~OAmMem&@k`LDAfg*c*{2oz^q`9+P3oD^1dC^z=i^|8 zz3L~rE7YEE7k%D6aFDDT1WkgUg_m1X%|M_XHBA&y15p!Z@y1)7f7qosn%u~A93Ip6 IXu2oh3);?OjsO4v diff --git a/CONTROLLER/__pycache__/program.cpython-36.pyc b/CONTROLLER/__pycache__/program.cpython-36.pyc index 56cba415784d8acd43876430922d6ad8489a6092..cc3b9cfbab019ffb3b50e05b350db3c1cdef82e4 100644 GIT binary patch delta 496 zcmYjM&r4fD5T4oHmu%uo)M%-oU<3_`LQvwNgi-<(suu|;C;`#vK7yL}UfjH(h6D;J zg&x!WJ8~+BAiaC&y^wu7Ff*T_b5SqHou|xuI#DTfP-xxQi>=6?t;1`(uvmm;Nv*xe0 zS;&*(Y`FzTumU^tZ60926n5yfv4t&u%yc^7iggfS@aI|<;Y4oH_B2?Stp(BeX>m`~1)g`qrUWYXo|N2;!fY?Z<1?^0}jT zUptjzZ|7Ww(y33RsM`d#g~h-2fkY?Ysd7$|13RCD)U|D@vFI#X+EUq y%)KmxW{B1)vlN+`9HCUAKpB=o#>vO!kQPK{EaOKem=+}aXnK+1XlNjnXtO6&BXBbS delta 672 zcmYjOL2DC16n<}JH<>nDqiM16psX#{?4=Y04?#3wsfrLH4Jd&Uww-m2?r!7k2DBuo zqpuqy$L;d_u!iisI$E9ef#FkoA14OUHh{9;L6g{;>r5Yy^o6k zKj6Q`iMPnos{|4xM$k2$Mc6~~JYq5Lah&g2UAP6(lJ+r3d&+wDth0rk*{eH_JaY`a zimdH|w>CXtXA+>$`KtgVnTJv(=X>M&G(+>Zun)>{~*fzmf{ zQYOIwSkj;I4OVrR{l*o2kAJ|mcfy(>Zs@mmcc(=;&zc#@&*+B7Y>HF14SO3CZvMvn z9E{Q66Q;H#o3Jt4rPk*DY3)9>L|SaUS-Nzs(9_*%dsc2MKM8}JM?s=&xR+Y$3)8GwjLh(xWT~ka!UQFn zi5y)%hyq`^W&*AmhMSDyec}%fmFtK8AaP?qId~Mb)dC&#SfNL`#EZZj%-Hg3QK@e# z6*_NUplE9D26nXCnGbyPUy|nKujSkxB*Rgrzn7bMS64-YJF20ZqE#_(s@4s7`lYyd uzD86~dqN0XoD!B;A>_)UuvgNbM7{cVN}(SI%A!-N`b1P6)3HE-4%r`11C$Q{ diff --git a/CONTROLLER/main.py b/CONTROLLER/main.py index 2204d26..59f4650 100644 --- a/CONTROLLER/main.py +++ b/CONTROLLER/main.py @@ -2,7 +2,7 @@ # coding: utf-8 from player import * from program import * -from player_game import * + if __name__ == "__main__": print("Hello start game") @@ -13,30 +13,23 @@ player.level_choice() game = Program() #result_lists = True -while 1: - result_lists = True - if result_lists == True: - #ask method to use level in program - game.get_level(player.level) - #ask method random number - game.random_choice() - #ask method for save number in list - game.add_list_choice() - #method for clear prompt - game.clear_terminal() - player_game = Player_entry() - #ask method for player entry number - player_game.player_entry() - #method for add to list number of user entry - player_game.add_user_list() - #print(Player_entry) - #print(player_game.__dict__) - #method for compare list player and program list - game.compare_list(player_game.player_list, result_lists) - game.clear_user_list() - if result_lists == False: - game.play_again() +result_lists = True +while result_lists == True: + # ask method to use level in program + game.get_level(player.level) + # ask method random number + game.random_choice() + # ask method for save number in list + game.add_list_choice() + # method for clear prompt + game.clear_terminal() + # ask method for compare number user and program list + game.compare_list(player.player_numbers, result_lists) + + +if result_lists == False: + game.play_again() diff --git a/CONTROLLER/player.py b/CONTROLLER/player.py index c154f8f..840ff8e 100644 --- a/CONTROLLER/player.py +++ b/CONTROLLER/player.py @@ -1,11 +1,13 @@ import os from time import sleep +from program import * class Player: """method for initialyse name""" def __init__(self): self.name = "" - self.level = None - + self.level = None + self.player_numbers = 0 + """method for ask and save name entry""" def name_entry(self): name = input("enter your name :") @@ -23,4 +25,11 @@ def level_choice(self): sleep(2) os.system("clear") return level - #print("{} you choice level {} start game ..........".format(self.name,level)) + + """ def player_entry(self): + save number entry user + self.player_numbers = int(input("enter numbers......:")) + player_numbers = self.player_numbers + #game.compare_list(player_numbers, result_lists) + return player_numbers""" + diff --git a/CONTROLLER/player_game.py b/CONTROLLER/player_game.py index 810b246..5df4351 100644 --- a/CONTROLLER/player_game.py +++ b/CONTROLLER/player_game.py @@ -7,16 +7,11 @@ def __init__(self): def player_entry(self): """save number entry user """ - player_numbers = int(input("enter numbers ......:")) - self.player_numbers = player_numbers - - def add_user_list(self): - """save in list number entry user""" - #print(self.player_list) - self.player_list.append(self.player_numbers) - player_list = self.player_list - #print(player_list) - return player_list + self.player_numbers = int(input("enter numbers......:")) + #self.player_numbers = player_numbers + return self.player_numbers + + #for i in range(0, len(self.program_list)): diff --git a/CONTROLLER/program.py b/CONTROLLER/program.py index 4f045bb..e74e289 100644 --- a/CONTROLLER/program.py +++ b/CONTROLLER/program.py @@ -1,34 +1,32 @@ from random import * import os from time import sleep -from player_game import * + class Program: """class for program controller """ def __init__(self): self.program_list = [] - self.user_list = [] self.numbers_program = None self.number_user = 0 self.level_choice = None - #self.result_lists = None + # self.result_lists = None def get_level(self, level): """method for save level choice user""" self.level_choice = level - #print(self.level_choice) def random_choice(self): """method for choice random number """ if self.level_choice == 3: - #select number betwen 1 and 100 + # select number betwen 1 and 100 self.numbers_program = randrange(1, 100) if self.level_choice == 2: - #select number betwen 1 and 20 + # select number betwen 1 and 20 self.numbers_program = randrange(1, 20) if self.level_choice == 1: - #select number between 1 and 10 + # select number between 1 and 10 self.numbers_program = randrange(1, 10) def add_list_choice(self): @@ -55,23 +53,17 @@ def clear_terminal(self): sleep(1) os.system("clear") - def compare_list(self, player_list, result_lists): + def compare_list(self, player_numbers, program_lists): """compare list user and list program """ - - for i in range(0, len(self.program_list)): - if self.program_list[i] == player_list[i]: - result_lists = True - return result_lists - print(result_lists) + #player_numbers = int(input("enter numbers ......:")) + for i in self.program_list: + player_numbers = int(input("enter numbers ......:")) + if player_numbers == i: + print("good number next") + + if player_numbers != i: + break - else: - result_lists = False - return result_lists - print(result_lists) - - def clear_user_list(self): - """clear user list number for again manche""" - player_list = [] def play_again(): """ask to player if his play again""" while play_again_choice != "yes" and play-again != "no": From 3a66e51d3a5e8ed80de9cb43bb4550c296df5177 Mon Sep 17 00:00:00 2001 From: nicos Date: Fri, 6 Dec 2019 16:53:28 +0100 Subject: [PATCH 16/29] change method compare and is not finish --- CONTROLLER/__pycache__/player.cpython-36.pyc | Bin 1217 -> 1215 bytes CONTROLLER/__pycache__/program.cpython-36.pyc | Bin 2310 -> 2329 bytes CONTROLLER/main.py | 45 +++++++++--------- CONTROLLER/player.py | 7 +-- CONTROLLER/program.py | 8 ++-- 5 files changed, 28 insertions(+), 32 deletions(-) diff --git a/CONTROLLER/__pycache__/player.cpython-36.pyc b/CONTROLLER/__pycache__/player.cpython-36.pyc index 139f25973508ce0ca74cea4c8244712ab305e384..d658c501ce54619dd82533b01ca64d27e282c1c8 100644 GIT binary patch delta 36 rcmX@exu28En3tF9OVO*?TIP*h;Ve8H3=9k$j4X^CY#eNp^I3ubuZjoF delta 38 scmdnbd61LKn3tDpQ`)Q87M6`%;VgVy3=9k$j4X^CY(OY5IhQ2}0JSj(p#T5? diff --git a/CONTROLLER/__pycache__/program.cpython-36.pyc b/CONTROLLER/__pycache__/program.cpython-36.pyc index cc3b9cfbab019ffb3b50e05b350db3c1cdef82e4..0a1750d02ecfcaf5ea69e929bfb7db15c9b29aa8 100644 GIT binary patch delta 198 zcmZn@nkmF-%*)G_RPieI-$u@-tWGuz3=9=!H4Iq{E)20cwag`qB}^%d%|KYoSi@Mu zoXu3ERl=OY)Xd1pP{;vfF@snEKz2Ao3QI79ChKH9Hb0&!uJpv*RE7Mq)FOq+HEcyp zT+EX{ut{1n0*wa&CMb3W(#2LlqQazxF@-UkxyYo1p@dO_A%zLdW&)WHvU#!-`&>4r ZA`YO^$q(4|7+ojxb1Y@#oxGJJ5CG1(E9n3L delta 178 zcmbO!)F#Af%*)GVllv<6`bN&DtPWNT3=9<}H4Iq{E)20+wag`qB}^%d%|KYoSi@Mu zoXu3EQNoZ`?H2EK!q$SWeFkl3d zOhD`m#Kka6QW&$Di%d!wN*E;=QkcMOrW9tNRSY!@lLOf2GBQs7%&y1iJXwijDI@pf H6C8m62|p)5 diff --git a/CONTROLLER/main.py b/CONTROLLER/main.py index 59f4650..be6f2da 100644 --- a/CONTROLLER/main.py +++ b/CONTROLLER/main.py @@ -6,30 +6,29 @@ if __name__ == "__main__": print("Hello start game") -player = Player() -#ask method name entry in player.py -player.name_entry() -#ask method level choice for user select level -player.level_choice() -game = Program() -#result_lists = True + player = Player() + #ask method name entry in player.py + player.name_entry() + #ask method level choice for user select level + player.level_choice() + game = Program() + #result_lists = True -result_lists = True -while result_lists == True: - # ask method to use level in program - game.get_level(player.level) - # ask method random number - game.random_choice() - # ask method for save number in list - game.add_list_choice() - # method for clear prompt - game.clear_terminal() - # ask method for compare number user and program list - game.compare_list(player.player_numbers, result_lists) - - -if result_lists == False: - game.play_again() + result_lists = True + while result_lists == True: + # ask method to use level in program + game.get_level(player.level) + # ask method random number + game.random_choice() + # ask method for save number in list + game.add_list_choice() + # method for clear prompt + game.clear_terminal() + # ask method for compare number user and program list + game.compare_list(player.player_numbers, result_lists) + if result_lists == False: + # ask method for restart or not game + game.play_again() diff --git a/CONTROLLER/player.py b/CONTROLLER/player.py index 840ff8e..1299c82 100644 --- a/CONTROLLER/player.py +++ b/CONTROLLER/player.py @@ -26,10 +26,5 @@ def level_choice(self): os.system("clear") return level - """ def player_entry(self): - save number entry user - self.player_numbers = int(input("enter numbers......:")) - player_numbers = self.player_numbers - #game.compare_list(player_numbers, result_lists) - return player_numbers""" + diff --git a/CONTROLLER/program.py b/CONTROLLER/program.py index e74e289..5d727f2 100644 --- a/CONTROLLER/program.py +++ b/CONTROLLER/program.py @@ -58,13 +58,15 @@ def compare_list(self, player_numbers, program_lists): #player_numbers = int(input("enter numbers ......:")) for i in self.program_list: player_numbers = int(input("enter numbers ......:")) - if player_numbers == i: + #while player_numbers == i: test loops while for break in else run print("good number next") - if player_numbers != i: + else: + print("game over ") break - def play_again(): + + def play_again(self): """ask to player if his play again""" while play_again_choice != "yes" and play-again != "no": play_again_choice = input("do you want to play again enter yes or no :") From 4540a932df345775c3c9ea8d9ab9ad05653521ca Mon Sep 17 00:00:00 2001 From: User Date: Sat, 7 Dec 2019 19:25:08 +0100 Subject: [PATCH 17/29] add comment in main.py --- CONTROLLER/main.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/CONTROLLER/main.py b/CONTROLLER/main.py index be6f2da..e5c92d8 100644 --- a/CONTROLLER/main.py +++ b/CONTROLLER/main.py @@ -2,7 +2,7 @@ # coding: utf-8 from player import * from program import * - +# import method of file in folder simon game if __name__ == "__main__": print("Hello start game") @@ -18,7 +18,7 @@ while result_lists == True: # ask method to use level in program game.get_level(player.level) - # ask method random number + # ask method random number game.random_choice() # ask method for save number in list game.add_list_choice() @@ -29,8 +29,3 @@ if result_lists == False: # ask method for restart or not game game.play_again() - - - - - From f434b4d04678b60db181701de79aad7266269f00 Mon Sep 17 00:00:00 2001 From: User Date: Sat, 7 Dec 2019 21:29:43 +0100 Subject: [PATCH 18/29] write in readme --- CONTROLLER/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CONTROLLER/README.md b/CONTROLLER/README.md index e69de29..5768787 100644 --- a/CONTROLLER/README.md +++ b/CONTROLLER/README.md @@ -0,0 +1,5 @@ +# folder controller +# in this folder +three file one file main for run program simon game +i use for this project "object attributes and method in pyhon" +i have create two files for two class and i create and instancies objet From 009e19818ad55cf0ed907734db45d9fd8f95aa91 Mon Sep 17 00:00:00 2001 From: User Date: Sat, 7 Dec 2019 21:36:52 +0100 Subject: [PATCH 19/29] write in readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index e69de29..18c93bb 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,4 @@ +#python game "simon" +this an model of pyhton game "simon" +i have create this game for project in python +i use class method object and attributes for this game From 573a413d09f7b99ea661e867f5593596f840dd1f Mon Sep 17 00:00:00 2001 From: User Date: Sun, 8 Dec 2019 09:58:06 +0100 Subject: [PATCH 20/29] work in method play again choice --- .idea/.gitignore | 2 + .../inspectionProfiles/profiles_settings.xml | 6 +++ .idea/misc.xml | 4 ++ .idea/modules.xml | 8 +++ .idea/simon_game.iml | 8 +++ .idea/vcs.xml | 6 +++ CONTROLLER/.idea/.gitignore | 2 + CONTROLLER/.idea/CONTROLLER.iml | 8 +++ .../inspectionProfiles/profiles_settings.xml | 6 +++ CONTROLLER/.idea/misc.xml | 4 ++ CONTROLLER/.idea/modules.xml | 8 +++ CONTROLLER/.idea/vcs.xml | 6 +++ CONTROLLER/__pycache__/main.cpython-38.pyc | Bin 0 -> 549 bytes CONTROLLER/__pycache__/player.cpython-38.pyc | Bin 0 -> 1235 bytes CONTROLLER/__pycache__/program.cpython-38.pyc | Bin 0 -> 2701 bytes CONTROLLER/main.py | 15 +++--- CONTROLLER/program.py | 47 ++++++++++++------ 17 files changed, 108 insertions(+), 22 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/simon_game.iml create mode 100644 .idea/vcs.xml create mode 100644 CONTROLLER/.idea/.gitignore create mode 100644 CONTROLLER/.idea/CONTROLLER.iml create mode 100644 CONTROLLER/.idea/inspectionProfiles/profiles_settings.xml create mode 100644 CONTROLLER/.idea/misc.xml create mode 100644 CONTROLLER/.idea/modules.xml create mode 100644 CONTROLLER/.idea/vcs.xml create mode 100644 CONTROLLER/__pycache__/main.cpython-38.pyc create mode 100644 CONTROLLER/__pycache__/player.cpython-38.pyc create mode 100644 CONTROLLER/__pycache__/program.cpython-38.pyc diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..e7e9d11 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,2 @@ +# Default ignored files +/workspace.xml diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..d1e22ec --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..2cbf479 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/simon_game.iml b/.idea/simon_game.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/simon_game.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/CONTROLLER/.idea/.gitignore b/CONTROLLER/.idea/.gitignore new file mode 100644 index 0000000..e7e9d11 --- /dev/null +++ b/CONTROLLER/.idea/.gitignore @@ -0,0 +1,2 @@ +# Default ignored files +/workspace.xml diff --git a/CONTROLLER/.idea/CONTROLLER.iml b/CONTROLLER/.idea/CONTROLLER.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/CONTROLLER/.idea/CONTROLLER.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/CONTROLLER/.idea/inspectionProfiles/profiles_settings.xml b/CONTROLLER/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/CONTROLLER/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/CONTROLLER/.idea/misc.xml b/CONTROLLER/.idea/misc.xml new file mode 100644 index 0000000..d1e22ec --- /dev/null +++ b/CONTROLLER/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/CONTROLLER/.idea/modules.xml b/CONTROLLER/.idea/modules.xml new file mode 100644 index 0000000..57ffd6b --- /dev/null +++ b/CONTROLLER/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/CONTROLLER/.idea/vcs.xml b/CONTROLLER/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/CONTROLLER/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/CONTROLLER/__pycache__/main.cpython-38.pyc b/CONTROLLER/__pycache__/main.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b146e4ce6031f378b768a6f54e4dcec04cd5000b GIT binary patch literal 549 zcmYjO&2H2%5FTf+skyD_U zhQ$uq0x(g@P2%owq(--l0j9Tb4G6<{3lzbSMa+riD!o1+E3i=Go00p9e0YHHvD}6{ zK1`yL57Rv!?r}z%hgfVA2A^IdRfzp!Uj{0B3-kOpO$Kx3*;CJjFtWBne3_k~*3D7Z zOV=N*q`}3Tv-u;RwOVe_`Mh<_%1IM4EPWNik6TyU-e(s(MGF6P^m)YP^G9Xmq^GgvC}Ty&2GKBNV}w` z_CcB>;*EUeRPhF!nDHi%f>-`L9*@WK&CI@ES!od%-*0|?xUdQNft%$4IjDTO zXhep%S`m${p+!-)Bm0=_5#b2;iU{}88ajd=k&br*cgUbawVOp!rXbK~Bh)Pq3pP72 zv!?)(45=VPOVFV$EMZ>}@MZiCUEzra>^Bn_JPe{T zlWY>iazw%9VxWv~?ZV6+0SG!J9O4J0!UD7e0nhe86NSbdTRZ4QyOI1NBYihD5AsP7 zf08N#Hclp^@i(F{g}^gTe9P!T$c6!(Q#6o0i(=9Ao9& z!)Oo)_28>kYgXOG`7H_<{vQfYV3PxhOL{@4K;X<$4~32LHJu@;nvOH5*5o9Yij_&B zOj;Q0D;I7L-MzO5N5{a^4JT=lYqv;KsT79Ou~ZWlBO87-+yR|#VOBUeRb?CYnGZmy z51&J;`*Q++ZT_QxZ<{K71VJpqw^bKt*k|?X;0pBIYpBv^Yi4MkJGngt3CKA)^h13% zr8Dc2Qj$Y|n6+{33x5WhDRyDAdc4#jSRFPxO~R36rmQ9tnr>>krRjF{y4&r3yPoX@%tSaIhod6O%lYLN+w99AE7?{*4n-u{cKm{)AsdeCWLkD4NK-Qqk>L=j2Ob({0^B8cWE4bDX};#^@P zs8xgw1pFhG0NX}6060y*V6XU|?-^~!RqJq|ojix_aH?7Q9M_60aDvs!sh>n8d26RQ~qJ6=%hRkTlP(W}D z*#fo!l^y6RSD(;|7=jX2OJf1bBRXp^RayXAt~QdL?7m?{bZ2eEyD*qr&q1(VD%T5w z&UHx9kb2dD)eXH0?t8LIVf9X}vE0=4{-EvQxNBBPAwDKjQv$N26sy1+3u^FLP!?^|PTk524G^c!z8ee#5!HSP zwt7yF2t>27*QJPaR^&{ilVZluWgCr*nkcyo%#{~SCIV!Cr`RiSlXlly@Ty#64+kynCkAqNBIB&6Jjh>ZR7mu&isq{F)Jzp3Z32kIXM?AwZw%q> zG|r;r3t&{A0s$8yZPFt?0Y`dcRIWExI?X=9hno-0k8^FLYcN3Iv}x=)c-Ilkb%4>i zy=zO4lLH6V?IY{J-7_`9F0YL8bP`F(4d`x|6BtB=nN8|EeRnu;3<~|zxi1uuz-JPp zs#<-WFl(n9csi-*?VwvY_MD230 z;7|KP#yc|>?=*24D?p2ZV+cqhZ%aY)GuZe6n$mwAC?#u9A9|#`*eJhn3l=wRlT#pIFk{mo+<}1(FtTf_z8+EV zj#~fQE}Vfq6Dput zUVg=MHp{2%*C;C*4s(VX%-|q{e+F63u5Xt9mVuO_dH1th@@-j!zuoFZqt&gVy)E yzOVNOt-v!iMPkONoFYzzNj;vyymC_bgQ5?=?Ul;EVRX2OaiAT@$AkmTr~d;q4|*5? literal 0 HcmV?d00001 diff --git a/CONTROLLER/main.py b/CONTROLLER/main.py index e5c92d8..a6080f0 100644 --- a/CONTROLLER/main.py +++ b/CONTROLLER/main.py @@ -2,7 +2,6 @@ # coding: utf-8 from player import * from program import * -# import method of file in folder simon game if __name__ == "__main__": print("Hello start game") @@ -13,9 +12,9 @@ player.level_choice() game = Program() #result_lists = True - + restart = True result_lists = True - while result_lists == True: + while result_lists != False: # ask method to use level in program game.get_level(player.level) # ask method random number @@ -26,6 +25,10 @@ game.clear_terminal() # ask method for compare number user and program list game.compare_list(player.player_numbers, result_lists) - if result_lists == False: - # ask method for restart or not game - game.play_again() + + #if result_lists == False: + #game.play_again_choice() + if restart == True: + __name__ == "__main__" + + diff --git a/CONTROLLER/program.py b/CONTROLLER/program.py index 5d727f2..d5d547f 100644 --- a/CONTROLLER/program.py +++ b/CONTROLLER/program.py @@ -1,6 +1,8 @@ from random import * import os from time import sleep +from player import * +from main import * class Program: """class for program controller """ @@ -9,7 +11,9 @@ def __init__(self): self.numbers_program = None self.number_user = 0 self.level_choice = None - # self.result_lists = None + self.play_again = None + self.result_lists = None + self.player_numbers = 0 def get_level(self, level): """method for save level choice user""" @@ -57,23 +61,34 @@ def compare_list(self, player_numbers, program_lists): """compare list user and list program """ #player_numbers = int(input("enter numbers ......:")) for i in self.program_list: - player_numbers = int(input("enter numbers ......:")) - #while player_numbers == i: test loops while for break in else run - print("good number next") - - else: - print("game over ") - break - - - def play_again(self): + self.player_numbers = self.player_numbers_entry() + if self.player_numbers != i: + result_lists = False + + pursuite = self.play_again_choice() + """else: + result_lists = True + return result_lists""" + + def player_numbers_entry(self): + """method for verify if number is an integer""" + try: + self.player_numb = int(input("enter numbers........:")) + except: + print("not good") + return self.player_numb + + def play_again_choice(self): """ask to player if his play again""" - while play_again_choice != "yes" and play-again != "no": - play_again_choice = input("do you want to play again enter yes or no :") - if play_again_choice == "yes": - __name__ == "__main__" + 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": + restart = True + return restart + else: - break + print("good bye") + exit() \ No newline at end of file From 9108d43f7be7eb6ae0597cf0360ca5e46553d4ad Mon Sep 17 00:00:00 2001 From: User Date: Sun, 8 Dec 2019 10:02:05 +0100 Subject: [PATCH 21/29] delete player-entry class --- .DS_Store | Bin 0 -> 6148 bytes CONTROLLER/.DS_Store | Bin 0 -> 6148 bytes CONTROLLER/player_game.py | 22 ---------------------- 3 files changed, 22 deletions(-) create mode 100644 .DS_Store create mode 100644 CONTROLLER/.DS_Store delete mode 100644 CONTROLLER/player_game.py diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..cdde960f388e4b85f792a5b82f46973c40368035 GIT binary patch literal 6148 zcmeHK-A>yu6h1EP=5(6Y3naMo4H6d>YReE86H+Mc1rjhs5WCnWNS10u3NdQaRa@67 zud%%WkHQo1IPCM!s+GbWnkM8E9e>C6`5fi5WyeIs+QYa>R3jn|S6K2;++(U=`J9z( zO9jaE7)SJ$_V9G+XfE3|{ErH#xvSC+=IwxvF>BNL+fC)CD3uZV)#7*qU%l0a=mAbN z8eCe=b#$2~gS^qWVWov~<=J!2tGxQM`Y||{qaY9S;h-J%->ceTn4d>BK9(|_#$j}l z^hT$(#T}XDVUqRwnw-QvqBM}4u5=1G1!fgkFx8qm|GN+0|7S_A<`i%WJShcOxf68S z_#}I_&V8IZYX$rau1w_>2B#DR`Y1-OI*OO!+R!dk0Q4;u2GIg@KLT0?S2zX!sRF+N D;nj6f literal 0 HcmV?d00001 diff --git a/CONTROLLER/.DS_Store b/CONTROLLER/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..d3f79d83b275057924ea811fe92163cab2e5f5cb GIT binary patch literal 6148 zcmeHKF;2rk5S$G`#H2|{>5?iEHI0d!f`SGfU=jxblEEkvMLIY9fiLhr9sskqr$8L1 zMF@7K-MKsO_?I5xrq|WCtQSZ2i4yKnVuliTxIwX%?E}A2 z0o}VHcdNh?R@}R<{VUF^x|~<_oEiFhoYId!g0Tf0;DOoqc*Iz_t?ai}cEX&B`76E~ z%Pxkzv>1nEEK%c@amKkiW|8+6C&4AAI75yL;+U*O>$!9luisX|uA3|13b+FQP65_z zwZYKPqbuMFxB_bh^!t#~6|;zqVfb_~gd+g4&*5Nf>(8Qc(ui5a#*kNNVpO70B_1)v z=p0XDUKX)2G&&?6J|xa8@q{8_cHTb?>5$COqbuMFY$~v4-I3P+>F)FYCdqrQfGhB) z6p(&?l~1^&SX;Lir?obvU(?kzuQ6Ox*a)SVxmt>k=)pLiYJ-?XYz#R<^B;jAg9lgO HM-})4Sd&l` literal 0 HcmV?d00001 diff --git a/CONTROLLER/player_game.py b/CONTROLLER/player_game.py deleted file mode 100644 index 5df4351..0000000 --- a/CONTROLLER/player_game.py +++ /dev/null @@ -1,22 +0,0 @@ -from program import * -class Player_entry: - """class for player entry and list for compare with program list""" - def __init__(self): - self.player_list = [] - self.player_numbers = 0 - - def player_entry(self): - """save number entry user """ - self.player_numbers = int(input("enter numbers......:")) - #self.player_numbers = player_numbers - return self.player_numbers - - #for i in range(0, len(self.program_list)): - - - - - - - - \ No newline at end of file From 987ea6f687225a836aa3381936fdf396f957a7a1 Mon Sep 17 00:00:00 2001 From: User Date: Sun, 8 Dec 2019 17:07:52 +0100 Subject: [PATCH 22/29] change main.py --- .DS_Store | Bin 6148 -> 6148 bytes CONTROLLER/.DS_Store | Bin 6148 -> 6148 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/.DS_Store b/.DS_Store index cdde960f388e4b85f792a5b82f46973c40368035..52e5e250446aca83305f0b4c078f1ae04d6ef690 100644 GIT binary patch delta 57 zcmZoMXfc@J&&akhU^gQp+hhkOiOniZQHtqKeiOniZQH+~sFz2&OY>?W_&heKY0LUB)>;M1& diff --git a/CONTROLLER/.DS_Store b/CONTROLLER/.DS_Store index d3f79d83b275057924ea811fe92163cab2e5f5cb..fea2e70175d987f8167836dada966c69216387d6 100644 GIT binary patch delta 319 zcmZoMXfc=|#>B!ku~2NHo+2ar#(>?7ixrre7}+QDFj-FKXA-YZDlaZb%E?b+U|=|z zRFIQdTw-8woso%|g_Vt+gM*8Miq2ING!=ng0e&M^K;81l9=$!yp;TMr~J~qlwz?4h~KZ&UgWd z>S|*nQym3EBa>Pkg=%wi104lZBjegyP7ZNZLtD>;+{&uzn%cUVK-U5RBO`=n;D^#M zY8KFYQW9msMR_^-dFddPK+MjN%aF*B$&fd>fk|X@64L~x&Fmcf9Khh&EXe$wc{0C< QBL`3&6UdOw5h81t0V_vRs{jB1 delta 71 zcmZoMXfc=|#>B)qu~2NHo+2ab#(>?7jI5IlS*0ecvB+ Date: Sun, 8 Dec 2019 17:10:12 +0100 Subject: [PATCH 23/29] Delete vcs.xml --- .idea/vcs.xml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .idea/vcs.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 4733beaa1e26a0eb95258e363bfa16a60923739e Mon Sep 17 00:00:00 2001 From: Turck Nicolas <56393359+Nicolas-Turck@users.noreply.github.com> Date: Sun, 8 Dec 2019 17:10:24 +0100 Subject: [PATCH 24/29] Delete simon_game.iml --- .idea/simon_game.iml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .idea/simon_game.iml diff --git a/.idea/simon_game.iml b/.idea/simon_game.iml deleted file mode 100644 index d0876a7..0000000 --- a/.idea/simon_game.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file From 71da1777f52c074c99816e1a803ddf6ab415ba7d Mon Sep 17 00:00:00 2001 From: Turck Nicolas <56393359+Nicolas-Turck@users.noreply.github.com> Date: Sun, 8 Dec 2019 17:10:35 +0100 Subject: [PATCH 25/29] Delete modules.xml --- .idea/modules.xml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .idea/modules.xml diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 2cbf479..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file From 33c8df52165adad03cf34725cc4007e59208457f Mon Sep 17 00:00:00 2001 From: Turck Nicolas <56393359+Nicolas-Turck@users.noreply.github.com> Date: Sun, 8 Dec 2019 17:10:44 +0100 Subject: [PATCH 26/29] Delete misc.xml --- .idea/misc.xml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 .idea/misc.xml diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index d1e22ec..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file From 984810228da77327422c2e501ba64df5cf3c9476 Mon Sep 17 00:00:00 2001 From: Turck Nicolas <56393359+Nicolas-Turck@users.noreply.github.com> Date: Sun, 8 Dec 2019 17:10:52 +0100 Subject: [PATCH 27/29] Delete .gitignore --- .idea/.gitignore | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .idea/.gitignore diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index e7e9d11..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Default ignored files -/workspace.xml From 3b880df9e56564644077371bb347b577f74f41bb Mon Sep 17 00:00:00 2001 From: Turck Nicolas <56393359+Nicolas-Turck@users.noreply.github.com> Date: Sun, 8 Dec 2019 17:11:06 +0100 Subject: [PATCH 28/29] Delete profiles_settings.xml --- .idea/inspectionProfiles/profiles_settings.xml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .idea/inspectionProfiles/profiles_settings.xml diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 105ce2d..0000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file From a289d7d6e06bbcecb44105bb11b85870e567e8a1 Mon Sep 17 00:00:00 2001 From: Turck Nicolas <56393359+Nicolas-Turck@users.noreply.github.com> Date: Sun, 8 Dec 2019 17:11:21 +0100 Subject: [PATCH 29/29] Delete .DS_Store --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 52e5e250446aca83305f0b4c078f1ae04d6ef690..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}(1u5S|Tzu2WUb0SS(KLFyr@l2F8Xg%m@8e*!!S*@5B5&vhk6W=_C%L zx-f4ApG+J+N)I_8CW?U1a z&CPmEY&6%$V~?+_HMVxoF0QUe-^Sm6=*J<37g*a%i+|xKf_nw}8uYSMW?wL`xQnz8 z@!ELx_hzKK!R%e>?qtr?@UQ?K+D4Uq;A^^|c)Au_nW=@YGpB%4z$x%}1?(q}KYu*c zF`NQUfhVqj`aTG_Lf>LxP=7km=pz8IjA3nv)$gL>2#dbO!XRc~%us=b%Ipz?89K&= z&GRi51`VB#g-$2t8+5Hxz$q}Tz=G*k)&Adk`20Ujay_SjQ{YJ{ zz{>5Q-NGZ;y>;&4)Ltv#XK-aIuP`{FAkbSea@AJ63fG2lp#q?9u`q}cnEMgXGPuSm I@J|)E1!WC-BLDyZ