Skip to content

Commit 3979e62

Browse files
author
shmelevik
committed
Add game end after fail
1 parent 8d25e81 commit 3979e62

File tree

11 files changed

+7
-18
lines changed

11 files changed

+7
-18
lines changed
0 Bytes
Binary file not shown.
-2 Bytes
Binary file not shown.

brain_games/cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ def welcome_user():
55
print('Welcome to the Brain Games!')
66
name = prompt.string('May I have your name? ')
77
print(f'Hello, {name}!\n')
8+
89
return name
-2 Bytes
Binary file not shown.
-41 Bytes
Binary file not shown.

brain_games/scripts/games/brain_calc.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ def calc_game(name):
3333
if answer != correct_answer:
3434
wrong_answer_output(answer, correct_answer, name)
3535

36-
sleep(2)
37-
38-
continue
36+
return
3937

4038
print('Correct!\n')
4139
sleep(1)

brain_games/scripts/games/brain_even.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ def is_even_game(name):
2323
if answer != correct_answer:
2424
wrong_answer_output(answer, correct_answer, name)
2525

26-
sleep(2)
27-
28-
correct_guesses = 0
29-
30-
continue
26+
return
3127

3228
print('Correct!\n')
3329
sleep(1)

brain_games/scripts/games/brain_gcd.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ def gcd_game(name):
3737
if answer != correct_answer:
3838
wrong_answer_output(answer, correct_answer, name)
3939

40-
sleep(2)
41-
42-
continue
40+
return
4341

4442
print('Correct!\n')
4543
sleep(1)

brain_games/scripts/games/brain_prime.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ def is_prime_game(name):
4646
if answer != correct_answer:
4747
wrong_answer_output(answer, correct_answer, name)
4848

49-
sleep(2)
50-
51-
continue
49+
return
5250

5351
print('Correct!\n')
5452
sleep(1)

brain_games/scripts/games/brain_progression.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ def progression_game(name):
2929
if answer != correct_answer:
3030
wrong_answer_output(answer, correct_answer, name)
3131

32-
sleep(2)
33-
34-
continue
32+
return
3533

3634
print('Correct!\n')
3735
sleep(1)

0 commit comments

Comments
 (0)