Skip to content

Commit 1c04b3a

Browse files
committed
Image Added into Industrial_developed_hangman readme
1 parent 60078fe commit 1c04b3a

File tree

7 files changed

+326
-0
lines changed

7 files changed

+326
-0
lines changed
Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
jam
2+
veteran
3+
environmental
4+
sound
5+
make
6+
first-hand
7+
disposition
8+
handy
9+
dance
10+
expression
11+
take
12+
professor
13+
swipe
14+
publisher
15+
tube
16+
thread
17+
paradox
18+
bold
19+
feeling
20+
seal
21+
medicine
22+
ancestor
23+
designer
24+
sustain
25+
define
26+
stomach
27+
minister
28+
coffee
29+
disorder
30+
cow
31+
clash
32+
sector
33+
discount
34+
anger
35+
nationalist
36+
cater
37+
mole
38+
speculate
39+
far
40+
retirement
41+
rub
42+
sample
43+
contribution
44+
distance
45+
palace
46+
holiday
47+
native
48+
debut
49+
steak
50+
tired
51+
pump
52+
mayor
53+
develop
54+
cool
55+
economics
56+
prospect
57+
regular
58+
suntan
59+
husband
60+
praise
61+
rule
62+
soprano
63+
secular
64+
interactive
65+
barrel
66+
permanent
67+
childish
68+
ministry
69+
rank
70+
ball
71+
difficult
72+
linger
73+
comfortable
74+
education
75+
grief
76+
check
77+
user
78+
fish
79+
catch
80+
aquarium
81+
photograph
82+
aisle
83+
justice
84+
preoccupation
85+
liberal
86+
diagram
87+
disturbance
88+
separation
89+
concentration
90+
tidy
91+
appointment
92+
fling
93+
exception
94+
gutter
95+
nature
96+
relieve
97+
illustrate
98+
bathtub
99+
cord
100+
bus
101+
divorce
102+
country
103+
mountain
104+
slump
105+
acquit
106+
inn
107+
achieve
108+
bloodshed
109+
bundle
110+
spell
111+
petty
112+
closed
113+
mud
114+
begin
115+
robot
116+
chorus
117+
prison
118+
lend
119+
bomb
120+
exploration
121+
wrist
122+
fist
123+
agency
124+
example
125+
factory
126+
disagreement
127+
assault
128+
absolute
129+
consider
130+
sign
131+
raw
132+
flood
133+
definition
134+
implication
135+
judge
136+
extraterrestrial
137+
corn
138+
breakfast
139+
shelter
140+
buffet
141+
seize
142+
credit
143+
hardship
144+
growth
145+
velvet
146+
application
147+
cheese
148+
secretion
149+
loop
150+
smile
151+
withdrawal
152+
execute
153+
daughter
154+
quota
155+
deny
156+
defeat
157+
knee
158+
brain
159+
packet
160+
ignorance
161+
core
162+
stumble
163+
glide
164+
reign
165+
huge
166+
position
167+
alive
168+
we
169+
gate
170+
replacement
171+
mourning
172+
incapable
173+
reach
174+
rehearsal
175+
profile
176+
fax
177+
sit
178+
compete
179+
smart
180+
gradient
181+
tough
182+
house
183+
pocket
184+
spider
185+
ditch
186+
critical
187+
ignorant
188+
policy
189+
experience
190+
exhibition
191+
forum
192+
contribution
193+
wrestle
194+
cave
195+
bet
196+
stool
197+
store
198+
formal
199+
basketball
200+
journal
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
╔══╗─╔╗╔╗╔══╗╔═══╗─╔══╗╔╗╔╗╔╗╔╗╔══╗
2+
║╔╗║─║║║║║╔═╝║╔══╝─║╔╗║║║║║║║║║║╔╗║
3+
║╚╝╚╗║║║║║║──║╚══╗─║║║║║║║║║║║║║╚╝║
4+
║╔═╗║║║╔║║║──║╔══╝─║║║║║║╔║║║║║║╔╗║
5+
║╚═╝║║╚╝║║╚═╗║╚══╗╔╝║║║║╚╝║║╚╝║║║║║
6+
╚═══╝╚══╝╚══╝╚═══╝╚═╝╚╝╚══╝╚══╗╚╝╚╝
7+
⡖⠒⢒⣶⠖⠒⠒⠒⡖⠒⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
8+
⡇⣠⠟⠁⠀⠀⠀⡖⠓⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
9+
⡿⠉⠀⠀⠀⠀⠀⢹⣞⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
10+
⡇⠀⠀⠀⠀⠀⣠⠻⡟⢧⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
11+
⠀ ⡇⠀⠀⠀⠀⠐⠃⢨⡧⠀⠳⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
12+
⠀⠀ ⡇⠀⠀⠀⠀⠀⠀⠠⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
13+
⠀⠀ ⡇⠀⠀⠀⠀⠀⠀⢨⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
14+
⠀⠀ ⡇⠀⠀⠀⠀⠀⠀⠆⠘⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
15+
⠀⠀ ⡇⠀⠀⠀⠀⠀⠈⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
16+
⠀⠀ ⠧⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤

Industrial_developed_hangman/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@ to install dependencies got to repository "Industrial_developed_hangman" by `cd
44

55
to start it use `make build` command
66

7+
example of programm run:
8+
9+
10+
![img.png](recorces/img.png)
11+
712
also makefile have lint command to lint source code
41.8 KB
Loading

Industrial_developed_hangman/tests/__init__.py

Whitespace-only changes.

Industrial_developed_hangman/tests/test_hangman/__init__.py

Whitespace-only changes.
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
import os
2+
from pathlib import Path
3+
from typing import Callable, List
4+
5+
import pytest
6+
import requests_mock
7+
8+
from src.hangman.main import (
9+
MainProcess,
10+
Source,
11+
parse_word_from_local,
12+
parse_word_from_site,
13+
)
14+
15+
16+
class FkPrint(object):
17+
def __init__(self) -> None:
18+
self.container: List[str] = []
19+
20+
def __call__(self, value_to_print: str) -> None:
21+
self.container.append(str(value_to_print))
22+
23+
24+
class FkInput(object):
25+
def __init__(self, values_to_input: List[str]) -> None:
26+
self.values_to_input: List[str] = values_to_input
27+
28+
def __call__(self) -> str:
29+
return self.values_to_input.pop(0)
30+
31+
32+
@pytest.fixture
33+
def choice_fn() -> Callable:
34+
return lambda array: array[0] # noqa: E731
35+
36+
37+
def test_parse_word_from_local() -> None:
38+
assert isinstance(parse_word_from_local(), str)
39+
40+
41+
def test_parse_word_from_local_error() -> None:
42+
data_path = Path(os.path.abspath('')) / 'Data'
43+
real_name = 'local_words.txt'
44+
time_name = 'local_words_not_exist.txt'
45+
46+
os.rename(data_path / real_name, data_path / time_name)
47+
with pytest.raises(FileNotFoundError):
48+
parse_word_from_local()
49+
os.rename(data_path / time_name, data_path / real_name)
50+
51+
52+
@pytest.mark.internet_required
53+
def test_parse_word_from_site() -> None:
54+
assert isinstance(parse_word_from_site(), str)
55+
56+
57+
def test_parse_word_from_site_no_internet() -> None:
58+
with requests_mock.Mocker() as mock:
59+
mock.get('https://randomword.com', text='<div id="random_word">some text</div>')
60+
assert parse_word_from_site() == 'some text'
61+
62+
63+
def test_parse_word_from_site_err() -> None:
64+
with pytest.raises(RuntimeError):
65+
parse_word_from_site(url='https://www.google.com/dsfsdfds/sdfsdf/sdfds')
66+
67+
68+
def test_get_word(choice_fn: Callable) -> None:
69+
fk_print = FkPrint()
70+
fk_input = FkInput(['none'])
71+
main_process = MainProcess(Source(1), pr_func=fk_print, in_func=fk_input, ch_func=choice_fn)
72+
73+
assert isinstance(main_process.get_word(), str)
74+
75+
76+
def test_start_game_win(choice_fn: Callable) -> None:
77+
fk_print = FkPrint()
78+
fk_input = FkInput(['j', 'a', 'm'])
79+
main_process = MainProcess(Source(0), pr_func=fk_print, in_func=fk_input, ch_func=choice_fn)
80+
81+
main_process.start_game()
82+
83+
assert 'YOU WON' in fk_print.container[-1]
84+
85+
86+
@pytest.mark.parametrize('input_str', [[letter] * 10 for letter in 'qwertyuiopasdfghjklzxcvbnm']) # noqa: WPS435
87+
def test_start_game_loose(input_str: List[str], choice_fn: Callable) -> None:
88+
fk_print = FkPrint()
89+
fk_input = FkInput(input_str)
90+
main_process = MainProcess(Source(0), pr_func=fk_print, in_func=fk_input, ch_func=choice_fn)
91+
92+
main_process.start_game()
93+
94+
assert 'YOU LOST' in fk_print.container[-1]
95+
96+
97+
def test_wow_year(freezer, choice_fn: Callable) -> None:
98+
freezer.move_to('2135-10-17')
99+
fk_print = FkPrint()
100+
fk_input = FkInput(['none'] * 100) # noqa: WPS435
101+
main_process = MainProcess(Source(0), pr_func=fk_print, in_func=fk_input, ch_func=choice_fn)
102+
103+
main_process.start_game()
104+
105+
assert 'this program' in fk_print.container[0]

0 commit comments

Comments
 (0)