Skip to content

Commit

Permalink
Merge pull request #9 from Nicolas-Turck/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Nicolas-Turck authored Dec 9, 2019
2 parents 59add2f + 1b2ba08 commit 46c44b4
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 12 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file modified CONTROLLER/__pycache__/main.cpython-38.pyc
Binary file not shown.
Binary file modified CONTROLLER/__pycache__/player.cpython-38.pyc
Binary file not shown.
Binary file modified CONTROLLER/__pycache__/program.cpython-38.pyc
Binary file not shown.
8 changes: 5 additions & 3 deletions CONTROLLER/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.....")





2 changes: 2 additions & 0 deletions CONTROLLER/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down
21 changes: 12 additions & 9 deletions CONTROLLER/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 46c44b4

Please sign in to comment.