A player ranking management system developed in Python, allowing you to add players, update scores, list rankings, search for players, and save/load data persistently through an interactive terminal menu.
- Add players: Register new players with name and score.
- Remove players: Delete a player from the ranking.
- Update scores: Add points to an existing player's score.
- List ranking: Display all players sorted by score (highest to lowest).
- Top players: Show players with scores above a certain threshold (40 points).
- Search players: Find a player by name.
- Persistent storage: Save and load players automatically using JSON files.
- Interactive interface: Terminal menu for easy use.
- Clone the repository:
git clone https://github.com/your-username/python-player-ranking.git
- Navigate to the project folder:
cd python-player-ranking
- Run the program:
python main.py
- Use the interactive menu to manage players:
[1] Add player [2] Remove player [3] Update score [4] List ranking [5] Top players [6] Search player [0] ExitData is saved automatically when you exit (0).
Players are stored in ranking.json for persistent storage.
ranking = Ranking()
ranking.adicionar_jogador("Alice", 50)
ranking.adicionar_jogador("Bob", 30)
ranking.atualizar_pontuacao("Bob", 15)
ranking.listar_ranking()
print(ranking.top_jogadores())
Alice: 50 pontos Bob: 45 pontos ['Alice', 'Bob']