Skip to content

Commit 167bae5

Browse files
Added files to India-state-guessing-game
1 parent d573698 commit 167bae5

File tree

9 files changed

+102
-0
lines changed

9 files changed

+102
-0
lines changed
Loading

India-state-guessing-game/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# India-state-guessing-game
2+
3+
## Tutorial
4+
5+
This can be used as an educational app to help Indian middle school students check whether they remember the names of all the states of India
6+
The game is played as follows:-
7+
1. You will be given a blank state map of India
8+
9+
<img src = "https://github.com/Souhardya-Ganguly/India-state-guessing-game/blob/main/snapshots/Blank_map.PNG"></img>
10+
11+
4. You will need to guess all the 30 states of India
12+
13+
<img src = "https://github.com/Souhardya-Ganguly/India-state-guessing-game/blob/main/snapshots/Input%20terminal.PNG"></img>
14+
15+
6. Once you guess the name of the state correctly, the name appears on the state
16+
17+
<img src = "https://github.com/Souhardya-Ganguly/India-state-guessing-game/blob/main/snapshots/Input%20terminal.PNG"></img>
18+
19+
8. If you cannot guess all the states correctly, the states that you could not guess is stored in a seperate .csv file
20+
21+
22+
23+

India-state-guessing-game/main.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import turtle
2+
import pandas as pd
3+
screen = turtle.Screen()
4+
screen.title("Indian states game")
5+
#screen.setup(width=500, height=500)
6+
image = "9671e6ba88f7b2ed4bea5941ffebf8ee (1).gif"
7+
8+
#def get_mouse_click_coor(x,y):
9+
# print(x,y)
10+
11+
#turtle.onscreenclick(get_mouse_click_coor)
12+
13+
data = pd.read_csv("states.csv")
14+
#print(data)
15+
all_states = data['States'].to_list()
16+
#print(all_states)
17+
guessed_states = []
18+
19+
screen.addshape(image)
20+
turtle.shape(image)
21+
22+
#answer_state = screen.textinput(title= "Guess the state", prompt= "Name a state!")
23+
24+
while len(guessed_states) < 30:
25+
answer_state = screen.textinput(title=f"{len(guessed_states)}/28 States Correct",
26+
prompt="What's another state's name?").title()
27+
if answer_state == "Exit":
28+
missing_states = []
29+
for state in all_states:
30+
if state not in guessed_states:
31+
missing_states.append(state)
32+
new_data = pd.DataFrame(missing_states)
33+
new_data.to_csv("states_to_learn.csv")
34+
break
35+
if answer_state in all_states:
36+
guessed_states.append(answer_state)
37+
t = turtle.Turtle()
38+
t.hideturtle()
39+
t.penup()
40+
state_data = data[data.States == answer_state]
41+
t.goto(int(state_data.x), int(state_data.y))
42+
t.write(answer_state)
43+
44+
#print(guessed_states)
45+
#print(missing_states)
46+
47+
turtle.mainloop()
Loading
Loading
Loading

India-state-guessing-game/states.csv

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
States,x,y
2+
Andhra Pradesh,-73,-192
3+
Arunachal Pradesh,285,127
4+
Assam,240,72
5+
Bihar,85,57
6+
Chhattisgarh,-1,-28
7+
Goa,-182,-184
8+
Gujarat,-249,-13
9+
Haryana,-132,139
10+
Himachal Pradesh,-107,211
11+
Jharkhand,55,8
12+
Karnataka,-152,-205
13+
Kerala,-129,-292
14+
Madhya Pradesh,-96,-6
15+
Maharashtra,-157,-89
16+
Manipur,253,31
17+
Meghalaya,193,53
18+
Mizoram,228,-3
19+
Nagaland,264,67
20+
Odisha,55,-65
21+
Punjab,-153,180
22+
Rajasthan,-194,75
23+
Sikkim,132,104
24+
Tamil Nadu,-87,-280
25+
Tripura,203,7
26+
Uttar Pradesh,-34,88
27+
Uttarakhand,-75,170
28+
West Bengal,123,-14
29+
Telengana,-71,-135
30+
Jammu And Kashmir,-137,278

India-state-guessing-game/states.xlsx

9.88 KB
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
,0
2+
0,Chhattisgarh

0 commit comments

Comments
 (0)