Skip to content

Commit 878615d

Browse files
committed
revised project
1 parent 14174e9 commit 878615d

28 files changed

+230
-238
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
.venv
2+
demo.cast
3+
__pycache__/

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ build:
88
uv build
99

1010
package-install:
11-
uv tool install dist/*.whl --reinstall
12-
11+
uv tool install dist/*.whl --force
12+
1313
make lint:
1414
uv run ruff check brain_games
1515

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
[![Maintainability](https://api.codeclimate.com/v1/badges/487e17fe16141caa4b2a/maintainability)](https://codeclimate.com/github/s-gala/python-project-49/maintainability)
66

77
### Asciinema even
8-
[![Demo](https://asciinema.org/a/2FfeOCm4Dq9QOqLXP9wKoP7lt)
8+
[![Demo](https://asciinema.org/a/d0DER5mtYI6eUx8QrBAQuZPD7)
99

10-
### Asciinema even and calc
10+
### Asciinema even calc
1111
[![Demo](https://asciinema.org/a/I5Igo5X4xIsyGS50CBBa0Qcld)
1212

1313
### Asciinema gcd
14-
[![Demo](https://asciinema.org/a/3Nyh8N1i0CPdvK2vNJtHHjDXW)
14+
[![Demo](https://asciinema.org/a/Sa6xEYjF5SZ9GlKZXa1UAEqUo)
1515

1616
### Asciinema progression
17-
[![Demo](https://asciinema.org/a/wWDvdSM2FQGVay1PpYbukSDEJ)
17+
[![Demo](https://asciinema.org/a/bCwx5SdlyhaWnMn1TQZIDxtuW)
1818

1919
### Asciinema prime
20-
[![Demo](https://asciinema.org/a/sO6fzPXbxSoQGADBqbjLcodLg)
20+
[![Demo](https://asciinema.org/a/PyxW5Rn3Wu3LMM1EyiPQGu9m3)

brain_games/for_brain_even.py

Lines changed: 0 additions & 35 deletions
This file was deleted.
-147 Bytes
Binary file not shown.
-168 Bytes
Binary file not shown.
-176 Bytes
Binary file not shown.
-136 Bytes
Binary file not shown.
-154 Bytes
Binary file not shown.

brain_games/games/for_all_games.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
import prompt
22

33

4-
def welcome_user():
4+
def welcome_user(INSTRUCTION):
55
name = prompt.string('May I have your name? ')
66
print(f'Hello, {name}!')
7+
print(INSTRUCTION)
78
return name
89

910

10-
def game_engine(instruction, questions_answers_calc, name):
11-
print(instruction)
12-
for item in questions_answers_calc:
13-
random_question, right_answer = item
14-
print('Question: ' + str(random_question))
15-
answer = prompt.string('Your answer: ')
16-
if right_answer != answer:
17-
print(f"'{answer}' is wrong answer;(. ", end='')
18-
print(f"Correct answer was '{right_answer}'.")
19-
print(f"Let's try again, {name}!")
20-
break
21-
else:
22-
print('Correct!')
11+
def game_engine(random_question, right_answer, name):
12+
print('Question: ' + str(random_question))
13+
answer = prompt.string('Your answer: ')
14+
if right_answer != answer:
15+
print(f"'{answer}' is wrong answer;(. ", end='')
16+
print(f"Correct answer was '{right_answer}'.")
17+
print(f"Let's try again, {name}!")
18+
return False
2319
else:
24-
print(f"Congratulations, {name}!")
20+
print('Correct!')
21+
return True
22+

0 commit comments

Comments
 (0)