When I was growing up and learning addition in elementary school, we played all the same, boring games to drill simple addition facts into our heads. These games felt terrible, and if you played one, you would have played them all. I wanted to change that. The generation of kids that are learning these facts today is the generation of the future. They have to stay engaged, and interested in learning. And the best way to promote an interest in learning is by making learning fun. So that is what I tried to do with Robbery Math.

Another piece of motivation for me to make this project was the fact that I would learn how to use AWS Lambda, the Alexa Skills Kit, and just the Alexa interface in general. My family enjoys programming for fun, and I enjoy learning more about the code. The constant problems to troubleshoot are difficult to solve, but they make me think, which I believe is very important. It’s necessary to challenge yourself as much as possible to push yourself to be the best you can be. I challenged myself to complete this project, and that is exactly what I managed to do.

What it does

This is an engaging skill geared towards children working on learning addition. It is meant to provide fun and helpful math review, by presenting a scenario. The user is an agent, and "Captain Alexa" gives the user math problems to work towards catching three robbers. By getting a question right, the user gets a point, and if a question was wrong, one of the robbers escaped. This is instead of losing lives and meant to keep the user engaged in the activity.

How I built Robbery Math

The Amazon Alexa Skill "Robbery Math" was built with JSON and node.js. I used a basic template provided by Amazon on GitHub, and then expanded upon that. After working on the project for many, many hours, very little of the code is the same as it was in the template. I changed a lot of code, added the wrong answer element (see below), and made it work better for me. The template was not meant for the sort of game that I made, so I dove headfirst into the code and made it work better for me.

The first thing I did was outline what I was planning. I am a big fan of organization and outlines, so I organized everything as best I could before beginning the actual project. I figured out all the problems, all the answers, potential variations of answers, and the outline for the project all before I opened a single file for coding. I have countless documents full of tables organizing something or another, yet they all have a very specific overall purpose: they all made me much more organized so I knew exactly what I was doing. This is also beneficial because rather than having to come up with the ideas for questions and answers while I’m working on the code, I can just copy and paste them into the files, which is exactly what I did.

My next step in this project was coding the actual program. I began by changing the JSON file that contained the prompts given by Alexa and the utterances that the skill recognizes. If these utterances are recognized, the skill goes to the next scene and reads the next prompt. This was the easiest part of the project. I then went on to build the interaction model and tested it for the first time. Everything was very exciting, and then it didn’t work. So I worked on fixing the problems, and there were a lot of them. When I eventually got it working again, I started working on making the “UnrecognizedIntent” lead to the scene for the wrong answer if called (see Challenges I ran into below for more details on this).

Challenges I ran into

The biggest problem that I had while making this program was figuring out a way for the problem to react to incorrect answers, and make the user lose a life. I thought about making an intent that had all possible wrong answers but quickly decided against that. I ended up using an "Unrecognized Intent" to my advantage. When called, I previously had the intent say "I'm sorry, I didn't catch that. Please repeat your command." Instead, I dove into the code and made it do different things based on the scene it was in. Each question asked is in a scene, and each scene leads to other scenes based on if the question is correct or not. I changed the code so the "Unrecognized Intent" leads to a different scene if the response is not recognized. After doing this, the program worked flawlessly!

Another major challenge that I ran into was the fact that usually when I fixed one error, three more things would break. There were times where I spent an hour working to fix one thing, only to break three others once I fixed the first, or I would modify something, breaking a couple other things in the process. One of those big examples was when I made the program give an encouraging response for correct answers, but in doing that, I messed up the LaunchIntent, making it not recognize the beginning of the game, and not being able to generate a response. I fixed it, multiple times, but doing so took a lot of time and energy.

Accomplishments that I'm proud of/What I learned

Whenever you work on a project, there are certain achievements you end up being proud of. In this case, I learned the basics of JSON and node.js interaction, and was able to extend my knowledge on AWS Lambda, AWS DynamoDB, and the Alexa Skills Kit, or ASK. These topics I gradually began to understand, yet am still learning about. This project taught me a lot about how all the different parts of the program work together to make an interactive, entertaining, working program.

What's next for Robbery Math

After getting Robbery Math published on the Amazon Alexa Skill Store, I felt pretty much done with Robbery Math. However, I am still hoping to update the code occasionally and might change some of the questions at times to keep the program interesting. Changing the questions occasionally will make the program new and interesting when updates are released. However, Robbery Math likely will not go through any big changes in the near future.

Share this project: