Skip to content

Commit

Permalink
Fix player 2 being forwarded to account creation when providing inval…
Browse files Browse the repository at this point in the history
…id input in register_players function in player_validation file
  • Loading branch information
vkleer committed Aug 4, 2022
1 parent d523e56 commit ddbc015
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions player_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,25 @@ def register_players():
game_logo()
for i in range(2):
if i == 1:
print('Player 2, would you like to create a new account,'
'or do you already have one?')
new_account = input('1. Create new account\n2. Already have '
'an account, go to login\n')
if new_account == '1':
clear_screen()
game_logo()
elif new_account == '2':
registration_complete = True
return
else:
print(f'You entered {new_account}, please enter either 1 '
'to confirm or 2 to cancel.')
confirm_input_bool = False
while not confirm_input_bool:
print('Player 2, would you like to create a new account,'
'or do you already have one?')
new_account = input('1. Create new account\n2. Already '
'have an account, go to log in menu\n')

if new_account == '1':
confirm_input_bool = True
clear_screen()
game_logo()
elif new_account == '2':
registration_complete = True
return
else:
clear_screen()
game_logo()
print(f'You entered {new_account}, please enter '
'either 1 to confirm or 2 to cancel.')

print("Let's start the registration process for player "
f"{i + 1}.")
Expand Down

0 comments on commit ddbc015

Please sign in to comment.