House Taken Over for Amazon Alexa

Image for post
Image for post
House Taken Over floor plans

House Taken Over is a short story by Julio Cortázar. Using the architecture implied in the text, I have developed an interactive journey for Amazon Alexa to be presented in a technology and literature seminar at Café Cortázar on May-2017

For this project I have used Amazon Lambda and Python programming code.

House architecture has been defined into a json file with the following format

{
“1”:
{
“name”:”Vestibule”,
“directions”:”f2",
“contents”:”Enameled tiles, wrought iron door”
},
“2”:
{
“name”:”Living room”,
“directions”:”f5,b1,l3,r4",
“contents”:”Tapestries, sofa, coffe table, rug and a lamp”
},
“3”:
{
“name”:”Narrators bedroom”,
“directions”:”r2",
“contents”:”Lamp, bed, cabinet, stamps and 15000 pesos”
},

Here is the piece of code in charge of house navigation

if str(direction)!=’’:
availableDirections=’’

# iterate through current room available directions
for myDirection in directionsArray:
if str(myDirection[:1])==’r’:
availableDirections += ‘ right’
if str(myDirection[:1])==’l’:
availableDirections += ‘ left’
if str(myDirection[:1])==’f’:
availableDirections += ‘ forward’
if str(myDirection[:1])==’b’:
availableDirections += ‘ backward’
# compare first letter of direction — to remove room — with first letter of speech which is a complete word like forward
if str(myDirection[:1])==direction[:1]:
# now get the other part: room number
#goesTo=int(myDirection[-1:])
goesTo=myDirection.replace(direction[:1],””)

if goesTo==0:

# search available directions
speech_output = “You cannot go in that direction. Available directions: “ +availableDirections
session_attributes = {“currentRoom”: currentRoom}

if goesTo>0:
speech_output = “Going to “ + str(data[str(goesTo)][‘name’])
# set new room in session
session_attributes = {“currentRoom”: goesTo}
else:
speech_output = “You should also say the direction. Example go forward”
session_attributes = {“currentRoom”: currentRoom}

The link to enable House Taken Over for Amazon Alexa is https://www.amazon.com/Comersus-Open-Technologies-House-Taken/dp/B071LRCNL8

Writer :: Maker :: Musician

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store