This is a simple tennis score calculator that can be used to figure out who won a tennis match based on the score.
This is a python based api endpoint using flask. To run the server make sure you have python installed.
- Python 3.10
- Flask
- Flask-Testing
- Clone the repo
git clone https://github.com/mbauer575/CS361_ScoreManager
- Install the required packages I recommend using a virtual environment
python -m venv venv .\venv\Scripts\activate
pip install -r requirements.txt
- Run the tests
python -m unittest test_scorekeeper.py
- Run the server
python scorekeeper.py
- POST /match_results: Accepts a Json object with the 'scores' key. The value should be a list of lists, where each inner list contains two integers representing the scores of player 1 and player 2 respectively. Each inner list represents a game. The endpoint will return the winner of the match.
POST request to /match_results
{
"scores": [[7, 6], [2, 6], [6, 3]]
}
Response
{
"result": "1"
}