Ever wanted to prove to your friend, you're better than him at coding! Challenge him to a game of HackOff. In this lightning paced coding environment, you can best your opponent in a battle to the end. Try it out here.
Inspired by intense duels between hacker and hacker, hacker and government, HackOff aims to bring that experience to you. The blood pressure raising, tension inducing contest will bring out your truest skills.
What it does
Hack Off is an interactive game which involves two players who competing against each other to solve coding challenges to make their move in the game integrated along with the challenge. Pick a difficulty: easy, medium or hard. You get more moves the harder your difficulty. Solve problems quicker, and use your advantage to outwit your opponent in an intense game of the mind.
How we built it
Our client is built using react and react-bootstrap, custom css styling has been used.
Our server uses sockets to connect and exchange data, we have a queue of games for multiple players and people to join.
Code Compiling API
We use a REST API to compile code and execute it on a remote server deployed on Heroku using a docker container, to solve our problems. It is capable of compiling python, C, C++ and java.
How it works
The players are given a player ID as soon as they are redirected to the home page of our website. A player and their friend are required to share their player IDs and move into the find opponent screen where they can input each others respective player IDs. All the communication between the clients and the server is carried out through a socket connection. Once the match is made the users are lead to a screen with a problem statement and an embedded text editor. The user solves the problem and submits it. This submission is then sent to a custom code compiler that we made ourselves using a post request to a docker container hosted in heroku. The stdout from the compiler is then checked with the test cases and if the user is successful he is awarded a move in the following tic tac toe game. The user has the choice of choosing the difficulty of the problem. Off course with greater difficulty, come greater rewards. Solving an easy question give the user a single move, medium questions present 2 moves and hard questions 3 moves. And then the cycle continues till one user stands out on top as the best hacker ever.
Challenges we ran into
- Redux: setting up of react redux was a difficult procedure
- Making custom chess version: We couldn't open source any chess engine as we were making our own version of chess where you could move more than once.
- Finding Problems: Finding data on coding problems was very difficult, we had to manually make questions for our game in the required format.
Accomplishments that we are proud of
- Front End- the front end of the application has resulted in a beautiful interface and seamless interface.
- Socket - the socket integration was quite smooth as well.
What I learned
- Front End - making clean react apps
- Socket- making of backends with socket connections
What's next for Hack Off
- Deploying our server onto a cloud engine
- Making more quality of life improvements, like friends, game sessions, and more games!