Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5a4b79f

Browse files
Merge pull request avinashkranjan#782 from Shubhrima/issue-778
Issue 778
2 parents 60f9735 + 813aad4 commit 5a4b79f

File tree

6 files changed

+269
-0
lines changed

6 files changed

+269
-0
lines changed

‎Guess the Countries/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Guess the Country
2+
3+
<p> Guess the name of the countries on the world map and score a point with every correct guess.</p>
4+
5+
# Output
6+
![blank](blank.png)
7+
![blank](guessed_countries.png)
8+
9+
# Author(s)
10+
Shubhrima Jana

‎Guess the Countries/blank.png

854 KB
Loading[フレーム]

‎Guess the Countries/country_names.csv

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
country,x,y
2+
Afghanistan,70.0,85.0
3+
Albania,-23.0,108.0
4+
Algeria,-65.0,62.0
5+
Andorra,-61.0,113.0
6+
Angola,-26.0,-70.0
7+
Antigua and Barbuda,-202.0,25.0
8+
Argentina,-207.0,-146.0
9+
Armenia,24.0,112.0
10+
Australia,219.0,-115.0
11+
Austria,-26.0,135.0
12+
Azerbaijan,21.0,123.0
13+
The Bahamas,-207.0,29.0
14+
Bahrain,40.0,64.0
15+
Bangladesh,129.0,51.0
16+
Barbados,-201.0,22.0
17+
Belarus,-9.0,152.0
18+
Belgium,-55.0,140.0
19+
Belize,-260.0,31.0
20+
Benin,-62.0,7.0
21+
Bhutan,127.0,64.0
22+
Bolivia,-207.0,-89.0
23+
Bosnia and Herzegovina,-36.0,131.0
24+
Botswana,-16.0,-105.0
25+
Brazil,-186.0,-57.0
26+
Brunei,190.0,-12.0
27+
Bulgaria,-14.0,115.0
28+
Burkina Faso,-69.0,14.0
29+
Burundi,11.0,-48.0
30+
Cabo Verde,-126.0,22.0
31+
Cambodia,-231.0,-18.0
32+
Cameroon,-41.0,-14.0
33+
Canada,-272.0,175.0
34+
Central African Republic,-21.0,-3.0
35+
Chad,-26.0,35.0
36+
Chile,-217.0,-109.0
37+
China,145.0,91.0
38+
Colombia,-230.0,-19.0
39+
Comoros,31.0,-69.0
40+
Democratic Republic of the Congo,-14.0,-39.0
41+
Republic of the Congo,-33.0,-30.0
42+
Costa Rica,-254.0,7.0
43+
Côte d’Ivoire,-82.0,-3.0
44+
Croatia,-34.0,127.0
45+
Cuba,-242.0,47.0
46+
Cyprus,-16.0,92.0
47+
Czech Republic,31.0,-69.0
48+
Denmark,-47.0,162.0
49+
Djibouti,18.0,25.0
50+
Dominica,-202.0,26.0
51+
Dominican Republic,-220.0,35.0
52+
East Timor (Timor-Leste),209.0,-58.0
53+
Ecuador,-242.0,-34.0
54+
Egypt,-2.0,63.0
55+
El Salvador,-263.0,18.0
56+
Equatorial Guinea,-44.0,-25.0
57+
Eritrea,26.0,11.0
58+
Estonia,-14.0,164.0
59+
Eswatini,0.0,-121.0
60+
Ethiopia,21.0,2.0
61+
Fiji,319.0,-91.0
62+
Finland,-15.0,185.0
63+
France,-61.0,129.0
64+
Gabon,-44.0,-33.0
65+
The Gambia,-100.0,21.0
66+
Georgia,22.0,114.0
67+
Germany,-45.0,145.0
68+
Ghana,-68.0,-1.0
69+
Greece,-21.0,105.0
70+
Grenada,-199.0,24.0
71+
Guatemala,-266.0,22.0
72+
Guinea,-101.0,5.0
73+
Guinea-Bissau,-99.0,5.0
74+
Guyana-198.0,-8.0
75+
Haiti,-226.0,37.0
76+
Honduras,-256.0,21.0
77+
Hungary,-28.0,129.0
78+
Iceland,-98.0,190.0
79+
India,99.0,53.0
80+
Indonesia,158.0,-37.0
81+
Iran,47.0,85.0
82+
Iraq,24.0,86.0
83+
Ireland,-80.0,151.0
84+
Israel,10.0,77.0
85+
Italy,-38.0,116.0
86+
Jamaica,-223.0,37.0
87+
Japan,218.0,93.0
88+
Jordan,19.0,73.0
89+
Kazakhstan,70.0,130.0
90+
Kenya,15.0,-30.0
91+
Kiribati,337.0,1.0
92+
Korea North,191.0,107.0
93+
Korea South,198.0,98.0
94+
Kosovo,-12.0,119.0
95+
Kuwait,35.0,72.0
96+
Kyrgyzstan,99.0,112.0
97+
Laos,155.0,39.0
98+
Latvia,-14.0,164.0
99+
Lebanon,11.0,76.0
100+
Lesotho,-6.0,-131.0
101+
Liberia,-91.0,-6.0
102+
Libya,-32.0,63.0
103+
Liechtenstein,-37.0,144.0
104+
Lithuania,-18.0,153.0
105+
Luxembourg,-52.0,138.0
106+
Madagascar,36.0,-94.0
107+
Malawi,8.0,-76.0
108+
Malaysia,159.0,-14.0
109+
Maldives,103.0,-16.0
110+
Mali,-72.0,34.0
111+
Malta,-37.0,101.0
112+
Marshall Islands,305.0,4.0
113+
Mauritania,-91.0,39.0
114+
Mauritius,62.0,-87.0
115+
Mexico,-287.0,53.0
116+
Federated States of Micronesia,245.0,2.0
117+
Moldova,-16.0,127.0
118+
Monaco,-54.0,122.0
119+
Mongolia,133.0,128.0
120+
Montenegro,-28.0,122.0
121+
Morocco,-80.0,85.0
122+
Mozambique,5.0,-104.0
123+
Myanmar (Burma),143.0,44.0
124+
Namibia,-32.0,-98.0
125+
Nauru,319.0,-1.0
126+
Nepal,110.0,68.0
127+
Netherlands,-54.0,147.0
128+
New Zealand,277.0,-178.0
129+
Nicaragua,-252.0,12.0
130+
Niger,-50.0,36.0
131+
Nigeria,-48.0,3.0
132+
North Macedonia,-25.0,113.0
133+
Norway,-48.0,177.0
134+
Oman,59.0,44.0
135+
Pakistan,83.0,76.0
136+
Palau,229.0,-1.0
137+
Panama,-247.0,2.0
138+
Papua New Guinea,264.0,-44.0
139+
Paraguay,-194.0,-108.0
140+
Peru,-235.0,-57.0
141+
Philippines,205.0,8.0
142+
Poland,-27.0,149.0
143+
Portugal,-82.0,109.0
144+
Qatar,42.0,57.0
145+
Romania,-13.0,125.0
146+
Russia,140.0,186.0
147+
Rwanda,-18.0,-20.0
148+
Saint Kitts and Nevis,-204.0,31.0
149+
Saint Lucia,-203.0,26.0
150+
Saint Vincent and the Grenadines,-203.0,19.0
151+
Samoa,317.0,-94.0
152+
San Marino,-39.0,126.0
153+
Sao Tome and Principe,-63.0,-25.0
154+
Saudi Arabia,22.0,61.0
155+
Senegal,-102.0,15.0
156+
Serbia,-15.0,138.0
157+
Seychelles,49.0,-52.0
158+
Sierra Leone,-95.0,-2.0
159+
Singapore,153.0,-21.0
160+
Slovakia,-34.0,126.0
161+
Slovenia,-26.0,128.0
162+
Solomon Islands,282.0,-7.0
163+
Somalia,42.0,5.0
164+
South Africa,-18.0,-129.0
165+
Spain,-77.0,114.0
166+
Sri Lanka,111.0,-4.0
167+
Sudan,-2.0,28.0
168+
Sudan South,0.0,2.0
169+
Suriname,-191.0,-15.0
170+
Sweden,-32.0,187.0
171+
Switzerland,59.0,134.0
172+
Syria,15.0,92.0
173+
Taiwan,193.0,51.0
174+
Tajikistan,98.0,102.0
175+
Tanzania,10.0,-49.0
176+
Thailand,153.0,27.0
177+
Togo,-65.0,-1.0
178+
Tonga,340.0,-70.0
179+
Trinidad and Tobago,-200.0,7.0
180+
Tunisia,-47.0,90.0
181+
Turkey,10.0,103.0
182+
Turkmenistan,57.0,105.0
183+
Tuvalu,313.0,-33.0
184+
Uganda,6.0,-23.0
185+
Ukraine,3.0,136.0
186+
United Arab Emirates,49.0,50.0
187+
United Kingdom,-68.0,162.0
188+
United States,-250.0,116.0
189+
Uruguay,-185.0,-140.0
190+
Uzbekistan,63.0,112.0
191+
Vanuatu,286.0,-68.0
192+
Vatican City,-44.0,121.0
193+
Venezuela,-213.0,-1.0
194+
Vietnam,171.0,16.0
195+
Yemen,42.0,27.0
196+
Zambia,-9.0,-82.0
197+
Zimbabwe,-1.0,-92.0
872 KB
Loading[フレーム]

‎Guess the Countries/main.py

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import turtle
2+
import pandas
3+
import pylint
4+
import random
5+
screen=turtle.Screen()
6+
7+
screen.title('Name the Countries')
8+
image='./Guess the Countries/world_map.gif'
9+
correct=0
10+
11+
screen.setup(width=800,height=500)
12+
screen.addshape(image)
13+
turtle.shape(image)
14+
15+
data=pandas.read_csv("./Guess the Countries/country_names.csv")
16+
countries= data.country.to_list()
17+
color = ['red','green','brown','orange','blue']
18+
random_color= random.randint(0,4)
19+
guessed=[]
20+
while True:
21+
if correct==196:
22+
country_turtle = turtle.Turtle()
23+
country_turtle.hideturtle()
24+
country_turtle.goto(0, 0)
25+
country_turtle.color('black')
26+
country_turtle.write("ALL CORRECT GUESSES", align="center", font=("Courrier", 35, "bold"))
27+
else:
28+
answer=screen.textinput(str(correct)+"/196 Correct Guesses", "Name the Country:")
29+
if answer is not None:
30+
answer=answer.lower()
31+
else:
32+
country_turtle = turtle.Turtle()
33+
country_turtle.hideturtle()
34+
country_turtle.goto(0, 0)
35+
country_turtle.color('black')
36+
country_turtle.write(str(correct)+" CORRECT GUESSES", align="center", font=("Courrier", 35, "bold"))
37+
break
38+
39+
if answer in guessed:
40+
print(guessed)
41+
else:
42+
country_turtle=turtle.Turtle()
43+
for i in range(0,len(countries)):
44+
country_name=countries[i]
45+
if answer==country_name.lower():
46+
print(country_name)
47+
guessed.append(answer)
48+
x_list = data['x'].to_list()
49+
y_list = data['y'].to_list()
50+
xcor= int(float(x_list[i]))
51+
ycor = int(float(y_list[i]))
52+
country_turtle.hideturtle()
53+
country_turtle.penup()
54+
random_color = random.randint(0, 4)
55+
country_turtle.color(color[random_color])
56+
country_turtle.goto(xcor, ycor)
57+
country_turtle.write(country_name, align="center", font=("Arial",7, "bold"))
58+
correct+=1
59+
60+
61+
62+
screen.exitonclick()

‎Guess the Countries/world_map.gif

90.1 KB
Loading[フレーム]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /