MastermindGame
An API to play mastermind game.
Created with CodeIgniter Framework
Axiom Zen questions
What was the hardest part?
Run against the time and implement the multiplayer feature.If you could go back and give yourself advice at the beginning of the project, what would it be?
Spend more time planning instead of code everything that came to your mind.If you could change something about this challenge, what would it be?
About the "bonus" part I would remove the instructions.
I would say only: "create a multiplayer version of the game (no more informations will be provided)".
It will make the competitors to unleash their creativity and make different kinds of rules and code.
How to run
All config instructions and API parameters are explained in README.md file
APIs
Single Player API
POST /api/new_game
POST /api/guess
Multiplayer API
POST /api/multiplayer_new_game
POST /api/multiplayer_join_game
POST /api/multiplayer_guess
POST /api/multiplayer_status
Why I made this code?
This code was make to a Vanhackathon challenge.
Original proposal:
The Game
Let's play Mastermind! If you've never played Mastermind, take a few minutes to check out the rules here:
https://en.wikipedia.org/wiki/Mastermind_(board_game)#Gameplay_and_rules.
We would also recommend taking some time to play a game or two with your teammates to get a better understanding of the game. The typical Mastermind game is played with 4 colors and 4 positions; however, for our challenge, we will be using 8 colors and 8 positions. Our engineering challenge will revolve around building different parts of this game.
There will be three separate challenges to this task. Any task by itself is sufficient for a hackathon submission.
Challenge One: Backend Implementation
Are you a backend architect that can spin up robust, well tested APIs? Then this may be the challenge for you.
Build an API that you can play Mastermind with! The language and stack you choose to use is it up to you. The endpoints you create and the structure are up to you but it must be able to support multiple users hitting the API at the same time playing different games of Mastermind and the API must respond with the proper number of exact and near matches for every guess.
To go a bit further, try implementing a multiplayer component to the game where a user can hit an endpoint to create a game and wait for another user to join the same game. Once the second user joins, the API waits for guesses from both users and responds to both users with its response once both guesses come in. The user that guesses the code first wins and the final response shows both users' guessing history.
...
Tools used
WampServer 2.5 64bits
PhpStorm
HeidiSQL
SmartGit
Postman

Log in or sign up for Devpost to join the conversation.