Skip to content

Commit c2a4778

Browse files
committed
added #NOSONAR
1 parent 52d2098 commit c2a4778

File tree

6 files changed

+107
-10
lines changed

6 files changed

+107
-10
lines changed

brain_games/games/brain_calc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ def generate_question():
1111
'-': operator.sub,
1212
'*': operator.mul
1313
}
14-
op_symbol = random.choice(list(operations.keys()))
15-
num1 = random.randint(1, 25)
16-
num2 = random.randint(1, 25)
14+
op_symbol = random.choice(list(operations.keys())) #NOSONAR
15+
num1 = random.randint(1, 25) #NOSONAR
16+
num2 = random.randint(1, 25) #NOSONAR
1717
operator_func = operations[op_symbol]
1818
question = f"{num1} {op_symbol} {num2}"
1919
correct_answer = operator_func(num1, num2)

brain_games/games/brain_even.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Question and correct answer generator for Even game.
77
def generate_question():
8-
number = random.randint(1, 100)
8+
number = random.randint(1, 100) #NOSONAR
99
question = str(number)
1010
correct_answer = 'yes' if number % 2 == 0 else 'no'
1111
return question, correct_answer

brain_games/games/brain_gcd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
# Question and correct answer generator for GCD game.
99
def generate_question():
10-
num1 = random.randint(1, 100)
11-
num2 = random.randint(1, 100)
10+
num1 = random.randint(1, 100) #NOSONAR
11+
num2 = random.randint(1, 100) #NOSONAR
1212
question = f"{num1} {num2}"
1313
correct_answer = math.gcd(num1, num2)
1414
return question, correct_answer

brain_games/games/brain_prime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def is_prime_number(n):
1717

1818
# Question and correct answer generator for Prime game.
1919
def generate_question():
20-
num = random.randint(1, 100)
20+
num = random.randint(1, 100) #NOSONAR
2121
question = str(num)
2222
correct_answer = 'yes' if is_prime_number(num) else 'no'
2323
return question, correct_answer

brain_games/games/brain_progression.py

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

66
# Question and correct answer generator for Brain Progression game.
77
def question_generator():
8-
progression_length = random.randint(5, 10)
9-
start = random.randint(1, 20)
10-
step = random.randint(1, 5)
8+
progression_length = random.randint(5, 10) #NOSONAR
9+
start = random.randint(1, 20) #NOSONAR
10+
step = random.randint(1, 5) #NOSONAR
1111
hidden_index = random.randint(1, progression_length - 2)
1212
progression = [str(start + i * step) for i in range(progression_length)]
1313
correct_answer = progression[hidden_index]

brain_prime.cast

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{"version": 2, "width": 120, "height": 30, "timestamp": 1761918185, "env": {"SHELL": "/bin/bash", "TERM": "xterm-256color"}}
2+
[0.021649, "o", "\u001b[?2004h\u001b]0;user_name123@AsusTUF: ~/python-project-49\u0007\u001b[01;32muser_name123@AsusTUF\u001b[00m:\u001b[01;34m~/python-project-49\u001b[00m$ "]
3+
[1.014394, "o", "m"]
4+
[1.127097, "o", "a"]
5+
[1.247116, "o", "k"]
6+
[1.394231, "o", "e"]
7+
[2.206556, "o", " "]
8+
[2.389119, "o", "p"]
9+
[2.579441, "o", "a"]
10+
[3.22537, "o", "c"]
11+
[3.37439, "o", "k"]
12+
[3.617073, "o", "a"]
13+
[3.873695, "o", "g"]
14+
[4.099107, "o", "e"]
15+
[5.04073, "o", "-"]
16+
[5.390751, "o", "i"]
17+
[5.655167, "o", "n"]
18+
[6.85904, "o", "s"]
19+
[7.053528, "o", "t"]
20+
[7.308858, "o", "a"]
21+
[7.538168, "o", "l"]
22+
[7.672578, "o", "l"]
23+
[8.119488, "o", "\r\n\u001b[?2004l\r"]
24+
[8.121523, "o", "uv tool install dist/*.whl\r\n"]
25+
[8.138181, "o", "\u001b[37m⠋\u001b[0m \u001b[2mResolving dependencies... \u001b[0m"]
26+
[8.13841, "o", "\r\u001b[2K\u001b[37m⠙\u001b[0m \u001b[2mResolving dependencies... \u001b[0m"]
27+
[8.138837, "o", "\r\u001b[2K"]
28+
[8.144422, "o", "\u001b[37m⠋\u001b[0m \u001b[2mResolving dependencies... \u001b[0m"]
29+
[8.144639, "o", "\r\u001b[2K\u001b[37m⠙\u001b[0m \u001b[2mResolving dependencies... \u001b[0m"]
30+
[8.146134, "o", "\r\u001b[2K"]
31+
[8.146335, "o", "\u001b[37m⠋\u001b[0m \u001b[2mResolving dependencies... \u001b[0m"]
32+
[8.146543, "o", "\r\u001b[2K\u001b[37m⠙\u001b[0m \u001b[2mResolving dependencies... \u001b[0m"]
33+
[8.147157, "o", "\r\u001b[2K\u001b[37m⠙\u001b[0m \u001b[2mhexlet-code==0.1.0 \u001b[0m"]
34+
[8.346766, "o", "\r\u001b[2K\u001b[37m⠹\u001b[0m \u001b[2mhexlet-code==0.1.0 \u001b[0m"]
35+
[8.506584, "o", "\r\u001b[2K\u001b[37m⠹\u001b[0m \u001b[2mprompt==0.4.1 \u001b[0m"]
36+
[8.506901, "o", "\r\u001b[2K\u001b[37m⠹\u001b[0m \u001b[2m \u001b[0m\r\u001b[2K"]
37+
[8.507152, "o", "\u001b[2mResolved \u001b[1m2 packages\u001b[0m \u001b[2min 362ms\u001b[0m\u001b[0m\r\n"]
38+
[8.50862, "o", "\u001b[37m⠋\u001b[0m \u001b[2mPreparing packages...\u001b[0m (0/0) \r\u001b[2K\u001b[37m⠋\u001b[0m \u001b[2mPreparing packages...\u001b[0m (0/1) "]
39+
[8.50884, "o", "\r\u001b[2K\u001b[37m⠙\u001b[0m \u001b[2mPreparing packages...\u001b[0m (0/1) "]
40+
[8.516677, "o", "\r\u001b[2K\u001b[37m⠙\u001b[0m \u001b[2m\u001b[0m (1/1) \r\u001b[2K\u001b[2mPrepared \u001b[1m1 package\u001b[0m \u001b[2min 8ms\u001b[0m\u001b[0m"]
41+
[8.516855, "o", "\r\n"]
42+
[8.521317, "o", "\u001b[2mUninstalled \u001b[1m1 package\u001b[0m \u001b[2min 4ms\u001b[0m\u001b[0m\r\n░░░░░░░░░░░░░░░░░░░░ [0/0] \u001b[2mInstalling wheels... \u001b[0m"]
43+
[8.521591, "o", "\r\u001b[2K░░░░░░░░░░░░░░░░░░░░ [0/1] \u001b[2mInstalling wheels... \u001b[0m"]
44+
[8.52651, "o", "\r\u001b[2K░░░░░░░░░░░░░░░░░░░░ [0/1] \u001b[2mhexlet-code==0.1.0 (from file:///home/user_name123/python-project-49/dist/hexlet_code-0.1.0-p\u001b[0m\r\u001b[2K████████████████████ [1/1] \u001b[2mhexlet-code==0.1.0 (from file:///home/user_name123/python-project-49/dist/hexlet_code-0.1.0-p\u001b[0m\r\u001b[2K\u001b[2mInstalled \u001b[1m1 package\u001b[0m \u001b[2min 5ms\u001b[0m\u001b[0m\r\n \u001b[33m~\u001b[39m"]
45+
[8.526636, "o", " \u001b[1mhexlet-code\u001b[0m\u001b[2m==0."]
46+
[8.526891, "o", "1.0 (from file:///home/user_name123/python-project-49/dist/hexlet_code-0.1.0-py3-none-any.whl)\u001b[0m\r\n"]
47+
[8.529576, "o", "Installed 6 executables: \u001b[1mbrain-calc\u001b[0m, \u001b[1mbrain-even\u001b[0m, \u001b[1mbrain-games\u001b[0m, \u001b[1mbrain-gcd\u001b[0m, \u001b[1mbrain-prime\u001b[0m, \u001b[1mbrain-progression\u001b[0m\r\n"]
48+
[8.535276, "o", "\u001b[?2004h\u001b]0;user_name123@AsusTUF: ~/python-project-49\u0007\u001b[01;32muser_name123@AsusTUF\u001b[00m:\u001b[01;34m~/python-project-49\u001b[00m$ "]
49+
[12.56063, "o", "b"]
50+
[12.852334, "o", "r"]
51+
[12.93055, "o", "a"]
52+
[13.067062, "o", "i"]
53+
[13.297732, "o", "n"]
54+
[14.315959, "o", "-"]
55+
[15.336228, "o", "p"]
56+
[15.728564, "o", "r"]
57+
[15.85446, "o", "i"]
58+
[16.275231, "o", "m"]
59+
[16.393923, "o", "e"]
60+
[16.742036, "o", "\r\n\u001b[?2004l\r"]
61+
[16.766021, "o", "Welcome to the Brain Games!\r\nMay I have your name? "]
62+
[17.748022, "o", "A"]
63+
[18.295155, "o", "n"]
64+
[18.792375, "o", "d"]
65+
[19.011629, "o", "r"]
66+
[19.085903, "o", "e"]
67+
[19.213329, "o", "y"]
68+
[19.623988, "o", "\r\n"]
69+
[19.624317, "o", "Hello, Andrey!\r\nAnswer \"yes\" if given number is prime. Otherwise answer \"no\".\r\nQuestion: 45\r\nYour answer: "]
70+
[20.757806, "o", "1"]
71+
[21.2277, "o", "\r\n"]
72+
[21.228264, "o", "'1' is wrong answer ;(. Correct answer was 'no'.\r\nLet's try again, Andrey!\r\nQuestion: 23\r\nYour answer: "]
73+
[26.35212, "o", "n"]
74+
[26.405088, "o", "o"]
75+
[27.092994, "o", "\r\n"]
76+
[27.093204, "o", "'no' is wrong answer ;(. Correct answer was 'yes'.\r\nLet's try again, Andrey!\r\n"]
77+
[27.093368, "o", "Question: 64\r\nYour answer: "]
78+
[29.256681, "o", "n"]
79+
[29.316755, "o", "o"]
80+
[29.695663, "o", "\r\n"]
81+
[29.695902, "o", "Correct!\r\nQuestion: 10\r\nYour answer: "]
82+
[31.113631, "o", "n"]
83+
[31.177039, "o", "o"]
84+
[31.511104, "o", "\r\nCorrect!\r\n"]
85+
[31.511312, "o", "Question: 42\r\nYour answer: "]
86+
[33.747328, "o", "n"]
87+
[33.789146, "o", "o"]
88+
[34.138217, "o", "\r\n"]
89+
[34.138481, "o", "Correct!\r\nCongratulations, Andrey!\r\n"]
90+
[34.144061, "o", "\u001b[?2004h\u001b]0;user_name123@AsusTUF: ~/python-project-49\u0007\u001b[01;32muser_name123@AsusTUF\u001b[00m:\u001b[01;34m~/python-project-49\u001b[00m$ "]
91+
[35.255035, "o", "e"]
92+
[35.774891, "o", "x"]
93+
[35.891824, "o", "i"]
94+
[36.037295, "o", "t"]
95+
[36.22713, "o", "\r\n"]
96+
[36.227399, "o", "\u001b[?2004l\r"]
97+
[36.22756, "o", "exit\r\n"]

0 commit comments

Comments
 (0)