File tree Expand file tree Collapse file tree 4 files changed +26
-2
lines changed Expand file tree Collapse file tree 4 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -22,5 +22,8 @@ brain-gcd:
2222brain-progresssion :
2323 uv run brain-progression
2424
25+ brain-prime :
26+ uv run brain-prime
27+
2528lint :
2629 uv run ruff check brain_games
Original file line number Diff line number Diff line change 1+ import random
2+ rules = 'Answer "yes" if given number is prime. Otherwise answer "no".'
3+ def get_round ():
4+ num = random .randint (1 , 50 )
5+ question = num
6+ for i in range (1 , num ):
7+ if num % i == 0 and i != num and i != 1 :
8+ correct_answer = 'no'
9+ break
10+ else :
11+ correct_answer = 'yes'
12+ return question , correct_answer
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+ from brain_games .engine import run_game
3+ from brain_games .games import prime
4+ def main ():
5+ run_game (prime )
6+
7+ if __name__ == '__main__' :
8+ main ()
Original file line number Diff line number Diff line change 11[project ]
22name = " hexlet-code"
3- version = " 0.5 .0"
3+ version = " 0.6 .0"
44description = " Add your description here"
55readme = " README.md"
66requires-python = " >=3.10"
@@ -25,4 +25,5 @@ brain-games = "brain_games.scripts.brain_games:main"
2525brain-even = " brain_games.scripts.brain_even:main"
2626brain-calc = " brain_games.scripts.brain_calc:main"
2727brain-gcd = " brain_games.scripts.brain_gcd:main"
28- brain-progression = " brain_games.scripts.brain_progression:main"
28+ brain-progression = " brain_games.scripts.brain_progression:main"
29+ brain-prime = " brain_games.scripts.brain_prime:main"
You can’t perform that action at this time.
0 commit comments