House Taken Over for Amazon Alexa

Roni Bandini
Jul 27, 2017 · 2 min read
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

Roni Bandini

Written by

Writer :: El sueño Colbert, La Gran Monterrey, Macadam - Inventor (sort of)

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade