diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..28937e7 Binary files /dev/null and b/.DS_Store differ diff --git a/CONTROLLER/__pycache__/main.cpython-38.pyc b/CONTROLLER/__pycache__/main.cpython-38.pyc index 7a575b5..8a7f991 100644 Binary files a/CONTROLLER/__pycache__/main.cpython-38.pyc and b/CONTROLLER/__pycache__/main.cpython-38.pyc differ diff --git a/CONTROLLER/__pycache__/player.cpython-38.pyc b/CONTROLLER/__pycache__/player.cpython-38.pyc index c12910a..974ad45 100644 Binary files a/CONTROLLER/__pycache__/player.cpython-38.pyc and b/CONTROLLER/__pycache__/player.cpython-38.pyc differ diff --git a/CONTROLLER/__pycache__/program.cpython-38.pyc b/CONTROLLER/__pycache__/program.cpython-38.pyc index e7e313e..f0459d6 100644 Binary files a/CONTROLLER/__pycache__/program.cpython-38.pyc and b/CONTROLLER/__pycache__/program.cpython-38.pyc differ 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 d285930..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,23 +68,25 @@ 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""" - try: - self.player_numbers = int(input("enter numbers........:")) - except: - print("not good") - return self.player_numbers + while True: + try: + self.player_numbers = int(input("enter numbers........:")) + except: + print("not good") + continue + return self.player_numbers def play_again_choice(self): """ask to player if his play again""" 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")