Why was Latticode created?

We created Latticode at HooHacks 2019 because we enjoy playing grid-based board games and thought it would be cool if we could create our own that we could play with friends. In the process, we designed Latticode to help teach intermediate level coders how to code. We remembered that when we were getting out of that beginner phase in our CS careers, there were not many resources online to help us get better. We thought that we could target this user base by giving people a way to apply their knowledge in a fun and applicable way. This would pique their interest in the field and help them improve their coding skills.

How does it work?

At its core, Latticode is composed of two components: the game helper library and the web interface.

Game Helper Library

The game helper library is designed to give users functionality that they are probably not comfortable with coding themselves at an intermediate level. This includes checking if there are n pieces in a row, making moves at a specific location on the board, simulating gravity, and much more.

The library also provides the functions required to link the code to the web interface, which involves creating the size of the board, adding pieces, and settings sprites for each of the pieces. By using this library, we were able to code chess in its entirety in just 150 lines of client code.

Web Interface

The web interface gives users the ability to see their code side by side with the game they have created. They are able to click save and then immediately see the changes they just made in action. This includes being able to click the pieces to see their legal moves and actually making the moves as well. If the game gets to the winning state, then the website will show winner message. This way, users are able to test their code in an intuitive manner that doesn't involve a lot of complicated console work or creating their own website.

You can check out our code on GitHub.