File tree Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -16,3 +16,8 @@ The first project on [Hexlet](https://ru.hexlet.io/professions/python/projects/4
1616### THE THIRD GAME: brain-gcd
1717
1818[ ![ asciicast] ( https://asciinema.org/a/vXRRiDnzBx0r5Q6xjE9iSBHZf.svg )] ( https://asciinema.org/a/vXRRiDnzBx0r5Q6xjE9iSBHZf )
19+
20+ ### THE FOURTH GAME: brain-progression
21+
22+ [ ![ asciicast] ( https://asciinema.org/a/kSeWIg1XFAvI37egtMgaKHNqK.svg )] ( https://asciinema.org/a/kSeWIg1XFAvI37egtMgaKHNqK )
23+
Original file line number Diff line number Diff line change 1+ from random import choice , randint
2+
3+ RULES = 'What number is missing in the progression?'
4+
5+
6+ def start_game ():
7+ step = randint (1 , 11 )
8+ rang = randint (12 , 16 )
9+
10+ progression = []
11+
12+ for i in range (2 , rang ):
13+ num = step * i
14+ progression .append (str (num ))
15+
16+ answer = choice (progression )
17+ question = ' ' .join (progression )
18+ question = question .replace (answer , '..' , 1 )
19+ return (question , answer )
Original file line number Diff line number Diff line change 1+ from brain_games .game_skeleton import game_start
2+ from brain_games .games import progression
3+
4+
5+ def main ():
6+ game_start (progression )
7+
8+
9+ if __name__ == "__main__" :
10+ main ()
Original file line number Diff line number Diff line change @@ -25,3 +25,4 @@ 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"
You can’t perform that action at this time.
0 commit comments