Skip to content

Commit 54cbeab

Browse files
committed
Добавлена игра «НОД» и добавлена аскинема в README.md
1 parent be3401e commit 54cbeab

File tree

5 files changed

+39
-8
lines changed

5 files changed

+39
-8
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
### Hexlet tests and linter status:
2+
[![Actions Status](https://github.com/dobro10k2/devops-engineer-from-scratch-project-49/actions/workflows/hexlet-check.yml/badge.svg)](https://github.com/dobro10k2/devops-engineer-from-scratch-project-49/actions)
3+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=dobro10k2_devops-engineer-from-scratch-project-49&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=dobro10k2_devops-engineer-from-scratch-project-49)
4+
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=dobro10k2_devops-engineer-from-scratch-project-49&metric=bugs)](https://sonarcloud.io/summary/new_code?id=dobro10k2_devops-engineer-from-scratch-project-49)
5+
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=dobro10k2_devops-engineer-from-scratch-project-49&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=dobro10k2_devops-engineer-from-scratch-project-49)
6+
[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=dobro10k2_devops-engineer-from-scratch-project-49&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=dobro10k2_devops-engineer-from-scratch-project-49)
7+
18
## Brain Even Game
29

310
[![asciicast](https://asciinema.org/a/8DwwSSP9EF5y4tOtpDo6AnD9X.svg)](https://asciinema.org/a/8DwwSSP9EF5y4tOtpDo6AnD9X)
@@ -6,9 +13,6 @@
613

714
[![asciicast](https://asciinema.org/a/m7bT1nfaEOEBUbLh7bkWmhMcP.svg)](https://asciinema.org/a/m7bT1nfaEOEBUbLh7bkWmhMcP)
815

9-
### Hexlet tests and linter status:
10-
[![Actions Status](https://github.com/dobro10k2/devops-engineer-from-scratch-project-49/actions/workflows/hexlet-check.yml/badge.svg)](https://github.com/dobro10k2/devops-engineer-from-scratch-project-49/actions)
11-
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=dobro10k2_devops-engineer-from-scratch-project-49&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=dobro10k2_devops-engineer-from-scratch-project-49)
12-
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=dobro10k2_devops-engineer-from-scratch-project-49&metric=bugs)](https://sonarcloud.io/summary/new_code?id=dobro10k2_devops-engineer-from-scratch-project-49)
13-
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=dobro10k2_devops-engineer-from-scratch-project-49&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=dobro10k2_devops-engineer-from-scratch-project-49)
14-
[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=dobro10k2_devops-engineer-from-scratch-project-49&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=dobro10k2_devops-engineer-from-scratch-project-49)
16+
## Brain Calc GCD
17+
18+
[![asciicast](https://asciinema.org/a/Y1jKRGnlfvNo1RInH0PZ8BLky.svg)](https://asciinema.org/a/Y1jKRGnlfvNo1RInH0PZ8BLky)

brain_games/games/gcd.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import math
2+
import random
3+
4+
TASK = "Find the greatest common divisor of given numbers."
5+
6+
7+
def get_round():
8+
num1 = random.randint(1, 100)
9+
num2 = random.randint(1, 100)
10+
11+
question = f"{num1} {num2}"
12+
correct_answer = str(math.gcd(num1, num2))
13+
14+
return question, correct_answer
15+

brain_games/scripts/brain_gcd.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from brain_games.engine import run_game
2+
from brain_games.games import gcd
3+
4+
5+
def main():
6+
run_game(gcd)
7+
8+
9+
if __name__ == "__main__":
10+
main()
11+

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "hexlet-code"
3-
version = "0.5.1"
3+
version = "0.6.1"
44
description = "Add your description here"
55
readme = "README.md"
66
requires-python = ">=3.12"
@@ -24,6 +24,7 @@ dev = [
2424
brain-games = "brain_games.scripts.brain_games:main"
2525
brain-even = "brain_games.scripts.brain_even:main"
2626
brain-calc = "brain_games.scripts.brain_calc:main"
27+
brain-gcd = "brain_games.scripts.brain_gcd:main"
2728

2829
[tool.ruff]
2930
line-length = 100

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)