About the app
Our friend wants to organize a Foosball tournament at her work, but there are many single players who need a teammate. While preparing a lunch she wrote a simple app that will help her to organize the tournament. Unfortunately, she got stuck due too messy code and asks you, the real programmer, for help. Make the code great again and the tournament reality!
In the kitchen we've found a cookbook with some notes on margins about the app:
Currently all the teams are created randomly. It's fine, but sometimes it would be good to pair players to have all the teams on similar level of strength. Therefore an attacker would be paired with defender or those who can play on both positions. Of course, those who are comfortable on both positions can play with each other in a team. Two defenders or two attackers are weaker than other combinations, so should be paired this way only when there are no other options.
The Assignment
There are two tasks in this assignment:
- Refactor the code to make it clean.
- Add the pairing functionality.
Refactor the app to make its code clean. While doing so try to also apply, where applicable, design principles and patterns known to you. They may be SOLID, GRASP patterns, Design Patterns, etc.
Do whatever you think is needed to make the code easier to change, test, and understand.
It's a software, remember? If we wouldn't be allowed to change it, it would be implemented as hardware.
How to submit solutions
TL;DR Copy this repository into your own private repository and add us as collaborators for a review.
The steps are, basically, as follows:
- Create a private repository. Do not create a fork!
- Copy this repository - either add it as a remote to your repository or just download a zip and commit into your repository. It doesn't matter. Just have a copy of this repository in your own private repository.
- Solve the assignment.
- In repository settings add olszowski as a collaborator.
- Wait for code review.
- Have fun and good luck!
๐
Outro
In case of any questions or comments, please create an issue here.