Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nicolas #10

Merged
merged 3 commits into from
Dec 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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