Skip to content

Commit a185c25

Browse files
update games
1 parent f62d737 commit a185c25

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

brain_games/games/calc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
OPERATIONS = [("+", add), ("-", sub), ("*", mul)]
77

8+
NUM1, NUM2 = randint(1, 100), randint(1, 100)
89

9-
def start_game():
10-
NUM1, NUM2 = randint(1, 100), randint(1, 100)
1110

11+
def start_game():
1212
operator, func = choice(OPERATIONS)
1313
question = f'{NUM1} {operator} {NUM2}'
1414
correct = func(NUM1, NUM2)

brain_games/games/even.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
RULES = 'Answer "yes" if the number is even, otherwise answer "no".'
44

5+
ANSWER = randint(1, 100)
56

6-
def start_game():
7-
ANSWER = randint(1, 100)
87

8+
def start_game():
99
if ANSWER % 2 == 0:
1010
is_even = 'yes'
1111
else:

brain_games/games/gcd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
RULES = 'Find the greatest common divisor of given numbers.'
44

5+
N1, N2 = randint(1, 100), randint(1, 100)
56

6-
def start_game():
7-
N1, N2 = randint(1, 100), randint(1, 100)
87

8+
def start_game():
99
max_divisor = min(N1, N2)
1010

1111
for num in range(1, max_divisor + 1):

brain_games/games/prime.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
RULES = 'Answer "yes" if given number is prime. Otherwise answer "no".'
44

5+
NUM = randint(1, 100)
6+
57

68
def start_game():
7-
NUM = randint(1, 100)
89
total = 0
910

1011
for i in range(1, NUM + 1):

brain_games/games/progression.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
RULES = 'What number is missing in the progression?'
44

5+
STEP = randint(1, 11)
6+
RANG = randint(12, 16)
57

6-
def start_game():
7-
STEP = randint(1, 11)
8-
RANG = randint(12, 16)
98

9+
def start_game():
1010
progression = []
1111

1212
for i in range(2, RANG):

0 commit comments

Comments
 (0)