diff --git a/us-states-game/50_states.csv b/us-states-game/50_states.csv new file mode 100644 index 0000000..4ff846c --- /dev/null +++ b/us-states-game/50_states.csv @@ -0,0 +1,51 @@ +state,x,y +Alabama,139,-77 +Alaska,-204,-170 +Arizona,-203,-40 +Arkansas,57,-53 +California,-297,13 +Colorado,-112,20 +Connecticut,297,96 +Delaware,275,42 +Florida,220,-145 +Georgia,182,-75 +Hawaii,-317,-143 +Idaho,-216,122 +Illinois,95,37 +Indiana,133,39 +Iowa,38,65 +Kansas,-17,5 +Kentucky,149,1 +Louisiana,59,-114 +Maine,319,164 +Maryland,288,27 +Massachusetts,312,112 +Michigan,148,101 +Minnesota,23,135 +Mississippi,94,-78 +Missouri,49,6 +Montana,-141,150 +Nebraska,-61,66 +Nevada,-257,56 +New Hampshire,302,127 +New Jersey,282,65 +New Mexico,-128,-43 +New York,236,104 +North Carolina,239,-22 +North Dakota,-44,158 +Ohio,176,52 +Oklahoma,-8,-41 +Oregon,-278,138 +Pennsylvania,238,72 +Rhode Island,318,94 +South Carolina,218,-51 +South Dakota,-44,109 +Tennessee,131,-34 +Texas,-38,-106 +Utah,-189,34 +Vermont,282,154 +Virginia,234,12 +Washington,-257,193 +West Virginia,200,20 +Wisconsin,83,113 +Wyoming,-134,90 \ No newline at end of file diff --git a/us-states-game/blank_states_img.gif b/us-states-game/blank_states_img.gif new file mode 100644 index 0000000..361f2d0 Binary files /dev/null and b/us-states-game/blank_states_img.gif differ diff --git a/us-states-game/main.py b/us-states-game/main.py new file mode 100644 index 0000000..59551d9 --- /dev/null +++ b/us-states-game/main.py @@ -0,0 +1,56 @@ + +import turtle +import pandas as pd +weather_infor = pd.read_csv('weather.csv') +# +# +# max_val= weather_infor['temp'].max() +# condition = weather_infor['condition'].tolist() +# row = weather_infor[weather_infor.temp ==max_val] +# print(row)#this returns the row that has the biggest temp +# +# data_dict = { +# "students": ["amy","james",'angela'], +# "scores":[12,14,17] +# } +# data = pandas.DataFrame(data_dict) +# data.to_csv('new_data.csv') + +scr = turtle.Screen() +scr.title('US STATES GAMES') + +image = "blank_states_img.gif" +scr.addshape(image) +turtle.shape(image) +#get the x and y values from csv int a tuple (x,y) +#ask the user for name of the state -- the key is +#name of the state and the value is the (x,y) +#if user types the state correctly the name of the +#state is goes to its values + +states =pd.read_csv('50_states.csv') +#keys are state x y +# print(states['state + +state = states['state'] +x_cor = states['x'] +y_cor = states['y'] +guessed_state = [] +missing_states = [] + + +while len(guessed_state)<50: + answer_state = scr.textinput(title=f'{len(guessed_state)/50} correct state', prompt="WHAT'S ANOTHER STATE'S NAME?") + + if answer_state.title() in state.tolist(): + t = turtle.Turtle() + t.hideturtle() + t.penup() + state_data = states[states.state == answer_state] + t.goto(int(state_data['x']),int(state_data['y'])) + t.write(state_data.state.item()) + + + + +scr.exitonclick() \ No newline at end of file diff --git a/us-states-game/weather.csv b/us-states-game/weather.csv new file mode 100644 index 0000000..1575183 --- /dev/null +++ b/us-states-game/weather.csv @@ -0,0 +1,8 @@ +day,temp,condition +Monday,12,Sunny +Tuesday,14,Rain +Wendsday,15,Rain +Thursday,14,Cloudy +Friday,21,Sunny +Saturday,22,Sunny +Sunday,24,Sunny \ No newline at end of file