forked from SK1723/HackPrincetonProject
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfindCompanionSkillduplicate.py
More file actions
192 lines (155 loc) · 5.71 KB
/
Copy pathfindCompanionSkillduplicate.py
File metadata and controls
192 lines (155 loc) · 5.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
import logging
import os
from random import randint
from flask import Flask, render_template
from flask_ask import Ask, statement, question, session
app = Flask(__name__)
ask = Ask(app, "/")
logging.getLogger("flask_ask").setLevel(logging.DEBUG)
BeginState = "S1"
endState = "S8"
movieTrans = dict()
movieTrans["S1"] = "S2"
yesTrans = dict()
yesTrans["S2"] = "S3"
noTrans = dict()
noTrans["S2"] = "S6"
concertTrans = dict()
concertTrans["S1"] = "S4"
sportsTrans = dict()
sportsTrans["S1"] = "S5"
basketballTrans = dict()
basketballTrans["S5"] = "S7"
baseballTrans = dict()
baseballTrans["S5"] = "S7"
footballTrans = dict()
footballTrans["S5"] = "S7"
tennisTrans = dict()
tennisTrans["S5"] = "S7"
golfTrans = dict()
golfTrans["S5"] = "S7"
volleyballTrans = dict()
volleyballTrans["S5"] = "S7"
hockeyTrans = dict()
hockeyTrans["S5"] = "S7"
specificMovieTrans = dict()
specificMovieTrans["S3"] = "S8"
specificMusicTrans = dict()
specificMusicTrans["S4"]="S8"
specificGenreTrans = dict()
specificGenreTrans["S6"]="S8"
@ask.launch
def start_skill():
session.attributes['state'] = BeginState
start = render_template(session.attributes['state'])
return question(start)
@ask.intent("MovieIntent")
def movie_intent():
session.attributes['state'] = movieTrans[session.attributes['state']]
round_msg = render_template(session.attributes['state'])
if(session.attributes['state'] == endState):
return statement(round_msg)
else:
return question(round_msg)
@ask.intent("YesIntent")
def yes_intent():
session.attributes['state'] = yesTrans[session.attributes['state']]
round_msg = render_template(session.attributes['state'])
if(session.attributes['state'] == endState):
return statement(round_msg)
else:
return question(round_msg)
@ask.intent("NoIntent")
def no_intent():
session.attributes['state'] = noTrans[session.attributes['state']]
round_msg = render_template(session.attributes['state'])
if(session.attributes['state'] == endState):
return statement(round_msg)
else:
return question(round_msg)
@ask.intent("ConcertIntent")
def concert_intent():
session.attributes['state'] = concertTrans[session.attributes['state']]
round_msg = render_template(session.attributes['state'])
if(session.attributes['state'] == endState):
return statement(round_msg)
else:
return question(round_msg)
@ask.intent("SportsIntent")
def sports_intent():
session.attributes['state'] = sportsTrans[session.attributes['state']]
round_msg = render_template(session.attributes['state'])
if(session.attributes['state'] == endState):
return statement(round_msg)
else:
return question(round_msg)
@ask.intent("BasketballIntent")
def basketball_intent():
session.attributes['state'] = basketballTrans[session.attributes['state']]
round_msg = render_template(session.attributes['state'])
if(session.attributes['state'] == endState):
return statement(round_msg)
else:
return question(round_msg)
@ask.intent("BaseballIntent")
def baseball_intent():
session.attributes['state'] = baseballTrans[session.attributes['state']]
round_msg = render_template(session.attributes['state'])
if(session.attributes['state'] == endState):
return statement(round_msg)
else:
return question(round_msg)
@ask.intent("FootballIntent")
def football_intent():
session.attributes['state'] = footballTrans[session.attributes['state']]
round_msg = render_template(session.attributes['state'])
if(session.attributes['state'] == endState):
return statement(round_msg)
else:
return question(round_msg)
@ask.intent("TennisIntent")
def tennis_intent():
session.attributes['state'] = tennisTrans[session.attributes['state']]
round_msg = render_template(session.attributes['state'])
if(session.attributes['state'] == endState):
return statement(round_msg)
else:
return question(round_msg)
@ask.intent("GolfIntent")
def golf_intent():
session.attributes['state'] = golfTrans[session.attributes['state']]
round_msg = render_template(session.attributes['state'])
if(session.attributes['state'] == endState):
return statement(round_msg)
else:
return question(round_msg)
@ask.intent("VolleyballIntent")
def volleyball_intent():
session.attributes['state'] = volleyballTrans[session.attributes['state']]
round_msg = render_template(session.attributes['state'])
if(session.attributes['state'] == endState):
return statement(round_msg)
else:
return question(round_msg)
@ask.intent("HockeyIntent")
def hockey_intent():
session.attributes['state'] = hockeyTrans[session.attributes['state']]
round_msg = render_template(session.attributes['state'])
if(session.attributes['state'] == endState):
return statement(round_msg)
else:
return question(round_msg)
@ask.intent("SpecificMovieIntent", convert={'moviePicked': 'movie'})
def movie_picked(moviePicked):
session.attributes['state'] = specificMovieTrans[session.attributes['state']]
return statement("Looking for people to watch {} with.".format(moviePicked))
@ask.intent("MusicIntent", convert={'bandPicked': 'MusicGroup'})
def band_picked(bandPicked):
session.attributes['state'] = specificMusicTrans[session.attributes['state']]
return statement("Looking for people to go to {}'s concert with.".format(bandPicked))
@ask.intent("GenreIntent", convert={'specificGenre': 'Genre'})
def genre_picked(specificGenre):
session.attributes['state'] = specificGenreTrans[session.attributes['state']]
return statement("Looking for people to watch {} movies with.".format(specificGenre))
if __name__== '__main__':
app.run(debug = True)