A fully functional tennis match simulator in python made from scratch which simulates a realistic best of 3 set tennis match point by point
This project was built with no external libraries at all, and it simulates the game purely off of math and randomness. This project:
- Asks for player names and their world ranking
- Simulates points, games, and sets with randomness weighted by player ranking
- Prints out a game by game report and a match result
-
Ensure Python is installed on your device (You can verify this by running the command python --version in your terminal/command prompt)
-
Download the script
- If you have git installed, run "clone https://github.com/Supposeduck30/tennis-match-simulator.git" in terminal/command prompt
- Or, download the zip file and extract it
-
Navigate to the directory containing the script
-
Run it by inputting into the command prompt/terminal "python Tennis_Match_Outcome_Generator.py"
-
ALTERNATIVE - Paste the code into an online python compiler or an IDE to run it
- Terminal based
- Asks for ranks and names of players
- Simulates the match game by game randomly weighted towards rank
- Outputs the score of each set
- Asks for ranks and names of players
- Simulates the match point by point
- Outputs a game by game summary with the score of each game
- Incorporates serving logic (who serves first, alternating serves, person is more likely to win their service game)
-
Fork the repository
-
Clone the fork
-
Make your changes to the code
-
Commit and push your changes to the fork
-
OPTIONAL - Create a pull request if you want the main repository to change the code with what you changed
- With the input of the ranks, it then simulates each game, randomizing who serves first and alternating from there
- A higher ranked player is mlre likely to win their service game
- It outputs the score of each game and who won
- The randomness makes it so the higher ranked is more likely to win, but there can be upsets
- The higher the difference in rank, the more likely it is for the higher ranked person to win
- If both players are inputted with the same rankings, it still works
- This simulator may oversimply the effects of rankings on match outcomes