File tree Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -5,3 +5,7 @@ def welcome_user():
55 name = prompt .string ('May I have your name? ' )
66 print (f'Hello, { name } !' )
77 return name
8+
9+
10+ def greet ():
11+ print ('Welcome to the Brain Games!' )
Original file line number Diff line number Diff line change @@ -7,11 +7,6 @@ def get_user_answer():
77 return prompt .string ('Your answer: ' )
88
99
10- def get_message_for_wrong_answer (user_answer , game_answer ):
11- message = ' is wrong answer ;(. Correct answer is '
12- return f"'{ user_answer } '{ message } '{ game_answer } '."
13-
14-
1510def engine (GAME_TASK , get_game_data ):
1611 print ('Welcome to the Brain Games!' )
1712 user_name = prompt .string ('May I have your name? ' )
@@ -25,7 +20,8 @@ def engine(GAME_TASK, get_game_data):
2520 if user_answer == game_answer :
2621 print ('Correct!' )
2722 else :
28- print (get_message_for_wrong_answer (user_answer , game_answer ))
23+ print (f"'{ user_answer } ' is wrong answer ;(. "
24+ f"Correct answer is '{ game_answer } '." )
2925 is_user_win = False
3026 break
3127 final_message = 'Congratulations' if is_user_win else "Let's try again"
Original file line number Diff line number Diff line change @@ -21,9 +21,9 @@ dev = [
2121]
2222
2323[project .scripts ]
24- brain-games = " brain_games.scripts. games.brain_games:main"
25- brain-even = " brain_games.scripts. games.brain_even:main"
26- brain-calc = " brain_games.scripts. games.brain_calc:main"
27- brain-gcd = " brain_games.scripts. games.brain_gcd:main"
28- brain-progression = " brain_games.scripts. games.brain_progression:main"
29- brain-prime = " brain_games.scripts. games.brain_prime:main"
24+ brain-games = " brain_games.games.brain_games:main"
25+ brain-even = " brain_games.games.brain_even:main"
26+ brain-calc = " brain_games.games.brain_calc:main"
27+ brain-gcd = " brain_games.games.brain_gcd:main"
28+ brain-progression = " brain_games.games.brain_progression:main"
29+ brain-prime = " brain_games.games.brain_prime:main"
You can’t perform that action at this time.
0 commit comments