Inspiration

This game is inspired by the ancient game of Nim, but modernized for Alexa with some key twists to keep the game interesting and easily repeatable for young players.

What it does

Pick Up Chips is a short, entertaining game. It pits the player against Alexa with 3 difficulty modes. The game begins with a semi-random number of chips on a table. The objective of the game is to not pick up the last chip on the table. Turns alternate between Alexa and the user, with Alexa always going first. During a turn, the player can choose to pick up 1, 2, or 3 chips from the table.

The three difficulty modes are Easy, Medium, and Hard; while Easy and Medium can be beatable, Hard is virtually impossible to beat (or at least I have yet to beat Alexa on Hard. Let me know if you managed to beat Alexa on Hard mode!)

Although easy to learn, this addicting game is challenging to master and can provide hours of fun for a child!

How I built it

Having never worked with Alexa or AWS Lambda before, I chose to use a language I was already familiar with: Python. I used an example Skill on the official Alexa GitHub pages to learn and understand how the sessions and interactions were handled with the Alexa model before jumping right in with my own project.

Challenges I ran into

Since this was my first time working with the Alexa model, it took me a while to get used to structuring the requests and responses within a session. There were numerous bugs that I had to iron out in polishing the overall game and keeping the experience as smooth as possible.

A significant challenge that I faced was maintaining the state of the game (i.e. the number of chips on the table at any given time). While I could have learned DynamoDB and used the database to record this data, it felt like this approach was using a cannon to kill a fly. I instead opted to keep this data in the JSON structures for requests and responses, which took a lot of trial-and-error to get just right. This ended up being fairly complicated, but it saved me from having another potential headache with the database.

Accomplishments that I'm proud of

Having never worked on a project like this before, there was a lot of troubleshooting I had to go through. A key accomplishment that took a huge amount of time to get right was input validation, since I had multiple utterances that were one word long. I could have easily made these utterances longer and required the user to recite additional words when deciding the difficulty or stating the number of chips to pick up, but I did not like this solution at all. In an effort to keep the user-experience streamlined, I spent a lot of time fiddling with the intents and utterances until I finally got it to work just right, where specific one-word utterances could go to a corresponding unique intent.

What's next for Pick Up Chips

I currently have some more ideas and features I'd like to add to Pick Up Chips. A nice quality-of-life adjustment I'd like to add would be to have the game prompt the player to play again once a game ends, rather than having it merely suggest this and then terminating the Skill.

Additionally, I'd like to tackle my fear of DynamoDB and implement a database, which could present opportunities for several new features. I would then be able to track statistics of the player, telling them their win percentages for each difficulty. Also, I could incorporate these into global rankings for all players who opted-in, using the data points of average number of turns played and win rates for each difficulty.

Share this project:

Updates