Skip to content

Commit ab59f0c

Browse files
committed
feat: add new functionality
1 parent 9177e0d commit ab59f0c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

brain_games/games/manual_games.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@ def game_instruction(number_game):
66
return "What is the result of the expression?"
77
elif number_game == 3:
88
return 'Find the greatest common divisor of given numbers.'
9+
elif number_game == 4:
10+
return 'What number is missing in the progression?'
911
else:
1012
return "There is no such number. Let's try again!"

brain_games/games/start_game.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44
from brain_games.games.check_even import check_even
55
from brain_games.games.manual_games import game_instruction
66
from brain_games.games.brain_gcd import find_gcd
7+
from brain_games.games.brain_progression import encrypt_sequence
78

89

910
def start_game():
1011
print("Welcome to the Brain Games!")
1112
user_name = prompt.string("May I have your name? ")
1213
print(f"Hello, {user_name}!")
1314
number_game = prompt.integer(
14-
'Choose a game: 1 - "checking for parity", 2 - "calculator", 3 - "greatest common divisor" '
15+
'Choose a game: 1 - "checking for parity", 2 - "calculator", 3 - "greatest common divisor", 4 - "number missing progression" '
1516
)
1617

17-
games = {1: check_even, 2: calculator, 3: find_gcd}
18+
games = {1: check_even, 2: calculator, 3: find_gcd, 4: encrypt_sequence} # словарь игр для выбора
1819
game_func = games.get(number_game)
1920

2021
print(game_instruction(number_game))
@@ -36,3 +37,4 @@ def start_game():
3637

3738
if correct_answers_count == 3:
3839
print(f"Congratulations, {user_name}!")
40+

0 commit comments

Comments
 (0)