๐ Scenario: Think of this as a Pokรฉmon game, but a bit more... wild. You've got monsters with stats like attack, defense, and perhaps a penchant for afternoon tea. Oh, and they battle each other. Let's build and fix it together!
๐ฏ What's already there:
- The CRUD for our battle arena.
- A nifty endpoint to see all the battles that have taken place (For those who love keeping score).
-
Implement the missing pieces:
- Endpoints to view our fierce monsters ๐ฒ.
- Starting a battle, because... well, it's a battle app ๐ฅ.
- Deleting a battle, for those "Oops, didn't mean to do that!" moments.
-
TODO or not TODO? That is the question.
- Work on tests marked with
TODO
.
- Work on tests marked with
-
๐จ Picasso Moment: Make sure your code is art - the code style check script should paint a pretty picture.
- ๐ซ Please, no tinkering with already set tests. If your code is pure gold, those tests should pass without drama.
- Oh, by the way, expect some bumps along the way while getting the app to run. But hey, debugging is part of the fun, right? ๐ We believe in you!
-
Fast and Furious: The monster with the jet-like speed attacks first. If speeds tie, the stronger attacker takes the lead.
-
๐งฎ Math Time: To figure out the damage, it's
attack - defense
. If the attack feels... meek, and is equal to or lower than the defense, damage is a humble 1. -
๐ฉน Ouch! Subtract the damage from the HP
(HP = HP - damage)
. -
Quick Battles: The monsters go back and forth until one emerges victorious. The battle endpoint should spill the beans about the winner in just one call.
-
And the winner is... whoever gets the enemy's HP down to zero. Simple, right?
-
Clone and Own: Get that repository onto your machine.
-
Let's Go Virtual: Set up the Python venv.
python -m venv venv
-
Grab All The Goodies: Install dependencies.
pip install -r requirements/requirements.txt
-
DB Magic: Handle database migrations and seeds.
make migrate
-
Lint It Up: Keep things tidy with:
make lint
-
Beautify: Automagically make most of your lint errors vanish:
make black
-
Kickstart the App: Because you want to see the magic:
make runserver
-
Test Time: See if your code is the hero we deserve:
make test
-
Module-specific Tests: Because sometimes you only want to study one chapter:
make test_module
- Monster endpoints: Up, running, and roaring.
- Battle endpoints: Perfectly set for action.
- The old tests should now be beaming with green ticks.
- The
TODO
tests? Nailed them! - A test coverage that boasts at least 80% (wear it like a badge!).
- The code style check? It should be giving you a standing ovation by the end.