Our initial motivation and inspiration to begin this project stemmed from our love for table card games. We'd spend nights playing blackjack and poker and realized how time-consuming it is to deal and shuffle cards. Also, when we played blackjack, one of us would always have to be dealer and that role was not very fun. We saw the Amazon Echo being used for other games, and realized we'd be able to use it for the card games that we know and love. During this hackathon, we built AlexaBlackJack, a blackjack card game which allows people to connect to an online game (set up by Alexa) from their phones.

What it does

AlexaBlackJack allows multiple users to connect to an online game of blackjack from their phones (hosted by Amazon Web Services) by opening a browser and going to and joining the room that Alexa directs them to. Once all of the players join, Alexa asks for bets (similar to a real blackjack table) and then each player is dealt two cards. The cards are seen on the player's device, along with the dealer's cards and the chip count for the respective player. Alexa goes around, asking for player commands (hit or stand). Once a player busts or is satisfied with their card total, Alexa announces the cards she drew and distributes any winnings earned by the players. All games are stored on the cloud using AWS S3 so the functionality to resume games can be built in the future.

How we built it

Pain and suffering and a little bit elbow grease.

We started by creating blackjack using the Deckofcards API in node.js. At the same time, another one of our teammates worked on setting up Amazon Web Services to create the Alexa skill, host the website, and store the games on the cloud. We also had a member of our team work on the website design. Once we were done with our respective pieces, we spent a majority of the time integrating the three parts together. We also spent a great amount of time debugging.

Challenges we ran into

One major problem we ran into while developing the game logic was dealing with how the ace is added to hands. We found a workaround where we automatically add the ace as an 11 and then subtract 10 for every ace when we are over 21 in our card value. In addition, the way the cards were dealt to the dealer became an issue as the dealer was not receiving enough cards, even when she was under 17 in card value. Some graphical issues were also encountered, such as having older cards display for a new hand or having too many cards added to the current hand. Keeping track of the game state when three different parts of the game require concurrent versions was difficult to handle.

Accomplishments that we're proud of

Well I mean one of our members recently was accepted into medical school so he was proud of that. Another member was proud that he made some really bad puns. Our last team member was proud actually sleeping at a hackathon for once, especially after having taken shots of monster energy drink in our provided toothpick holders.

In terms of the project, we were most proud of being able to integrate these various services & functionalities. We were also proud of being able to overcome the bugs that we encountered.

What we learned

Although most of the knowledge regarding the programming languages was already understood, we definitely learned how to integrate these services together. We learned about team synergy and fostered a sense of thought management. We also incorporated cloud computing and channeled our creativity to provide the best end-user interface. Finally, we thoroughly investigated business buzzwords to best enable synergistic management solutions within our strategized efforts.

What's next for AlexaBlackJack

One word: Poker.

Share this project: