Introducing the Chext best thing! If you have ever felt the need to challenge your friend in chess to decide who is the victor once and for all in a game of unimaginable skill, only to be foiled by the fact that your friend is in fact 400 miles away and you have run out of data on your phone. Well now finally you can play chess purely through SMS with a friend wherever they are with no internet connection required.

Inspiration

We wanted to work with Twilio to learn how to do some cool things over text. We had planned to build a simple app to dip our feet into the water so that we could then apply it to a sponsored vendor, but the chess bug got hold of us and what started as an exploratory venture turned into a mission, a desire, a need, to create a better and more simple way to play chess on the phone with another person.

What it does

A user texts our Twilio number with the word "Start" and then will be provided with a 4 letter code that they can give to whoever they want to play against. The second user then texts the same number, accepting the call to arms, with "Join" and the code. Both players will then be greeted with their ASCII battlefield, when it is the relevant players turn they simply text the starting end ending coordinates of the move they want to make. We then automatically verify the move and update the game board with the move.

How I built it

We used Twilio for the text server and hub for our web-hooks. We built out the chess game and logic that drives the text messages in java script using node.js and express for our server. We also used ngrok to simulate a live deployed server for us to successfully test out the service.

Challenges I ran into

We realized that chess is not as easy to code up as we initially thought. There are a lot of edge case rules and scenarios where different rules apply (castling, pawn promotion etc.). We also came up against the challenge of phones having different font sizes and spacing out text differently meaning an ASCII chessboard on one phone looked different to anothers.

Accomplishments that I'm proud of

We learnt the ins and outs of Twilio and web-hooks, and were able to achieve what we set out to do.i

What I learned

Chess is not easy. Also that web-hooks are powerful tools that can help in a range of applications.

What's next for Chext

We are going global! Partnering with Chex mix to make Chexts Chex Mix.We are also looking into building out scale by incorporating a db to save board states of multiple lobby's so that we can have several games going at once and bring the Chext glory to the people. We also have multiple other features we want to work out such as experimenting with different text message formats that may have more uniformity between platforms.

Share this project:

Updates