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

review code #12

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
6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/simon_game.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 21 additions & 10 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified CONTROLLER/__pycache__/main.cpython-38.pyc
Binary file not shown.
Binary file modified CONTROLLER/__pycache__/program.cpython-38.pyc
Binary file not shown.
42 changes: 22 additions & 20 deletions CONTROLLER/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,32 @@
if __name__ == "__main__":
print("Hello start game")
player = Player()
#ask method name entry in player.py for entry name
player.name_entry()
# ask method for choice level of game
player.level_choice()
game = Program()
continue_game = True
play_again = True
while play_again == True:
numbers = None
# 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
if game.compare_list(player.player_numbers, numbers) == False:
print("game over")
break
pursuite = Program()
pursuite.play_again_choice()
if play_again == True:
print("replay.....")
#ask method name entry in player.py
player.name_entry()
# ask method for choice level of game
player.level_choice()
while continue_game == 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
if game.compare_list() == False:
break
pursuite = Program()
# ask method for choice replay or not
pursuite.play_again_choice()
if play_again == True:
print("replay.....")



Expand Down
10 changes: 4 additions & 6 deletions CONTROLLER/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,13 @@ def clear_terminal(self):
sleep(1)
os.system("clear")

def compare_list(self, player_numbers, program_lists):
def compare_list(self):
"""compare list user and list program """
#player_numbers = int(input("enter numbers ......:"))
for i in self.program_list:
self.player_numbers = self.player_numbers_entry()
if self.player_numbers != i:
numbers = False
return numbers
self.program_list = []
return False

def player_numbers_entry(self):
"""method for verify if number is an integer"""
Expand All @@ -85,8 +84,7 @@ def play_again_choice(self):
if self.play_again == "yes":
self.program_list = []
return self.play_again
#self.play_again = True
#return self.play_again


else:
print("good bye")
Expand Down