Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put a three round system and all round scores stored in local files then average of all round score commit a winner #219

Open
kashish6398 opened this issue Oct 12, 2024 · 0 comments

Comments

@kashish6398
Copy link

a three-round system where the scores from all three rounds are recorded, averaged, and used to determine the winner. Here’s a detailed breakdown of how you could structure the system:

Feature Implementation Plan

  1. Three-Round System
    The game consists of three rounds of Tic-Tac-Toe.
    After each round, the score for each player is determined based on the outcome (win, lose, or draw).
    These scores are stored locally in files for future reference or review.
  2. Score Calculation
    Win: A player receives a specific score (e.g., 10 points).
    Loss: The player receives no points (0 points).
    Draw: Each player gets a smaller number of points (e.g., 5 points each).
    The score for each round should be saved in a local file such as round1_score.txt, round2_score.txt, and round3_score.txt.
  3. Storing Scores Locally
    Each round’s score will be saved in a local file using a simple text or JSON format.
    You can store the scores in individual files for each round, or in a single file with entries for all rounds.
  4. Calculating the Average Score
    After all three rounds are completed, the average score for each player is calculated by summing up their scores across all rounds and dividing by the total number of rounds.
    Formula:
    Average Score
    =
    Total Score of All Rounds
    3
    Average Score=
    3
    Total Score of All Rounds

Example: If Player 1 scores 10 in Round 1, 0 in Round 2, and 5 in Round 3, their total score is 15. The average score is:
Average=(10+0+5)/3=5
Average= 3

  1. Declaring the Winner
    After the average score is computed for each player, the winner is declared based on the higher average.
    In the event of a tie (same average score for both players), additional rules can be added such as:
    Playing another tie-breaking round.
    Declaring the game a draw.
  2. File Management & Updates
    After each round, the score files should be updated to reflect the latest round’s outcome.
    Once the final round is complete, the system will calculate the averages from the files and declare the winner.
    Additional Features for Future Implementation
    Leaderboard System: Add a leaderboard that tracks multiple games and rounds to display a history of past winners and scores.
    Player Profiles: Allow players to create profiles where their game statistics and scores are saved.
    Game Replay: Save each game’s moves so players can review previous games round-by-round.
    This system adds a competitive edge to the Tic-Tac-Toe game and gives players a more engaging experience through multiple rounds and score tracking.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant