Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Tennis Scorer Web App

A web application for tracking tennis matches, built with Python Flask, HTML, and CSS.

Features

  • Create tennis matches with two players
  • Track points, games, and sets in real-time
  • Follow traditional tennis scoring rules (0, 15, 30, 40, Deuce, Advantage)
  • Responsive design that works on desktop and mobile devices
  • Persistent storage of matches in a database
  • View match history and access previous matches
  • Delete matches when no longer needed
  • Detailed scoring options (Ace, Winner, Unforced Error, Forced Error, Fault)
  • Serving player tracking with visual indicators
  • Double fault system (first fault -> second fault = point for opponent)
  • Enhanced user interface with score display at the top

Installation

  1. Clone or download this repository
  2. Create a virtual environment:
    python3 -m venv venv
  3. Activate the virtual environment:
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  4. Install the required dependencies:
    pip install -r requirements.txt

Usage

  1. Run the application:

    python app.py
  2. Open your web browser and go to http://localhost:5000

  3. Create a new game by entering the names of the two players

  4. Use the detailed scoring buttons to track specific point types:

    • Ace: An untouched serve that wins the point (only available for serving player)
    • Winner: A shot that the opponent cannot reach
    • Unforced Error: An error made without significant opponent pressure
    • Forced Error: An error caused by the opponent's good play
    • Fault: An invalid serve (only available for serving player)
    • Double Fault: Two consecutive faults result in a point for the opponent
  5. The serving player is indicated by a red dot next to their name

  6. Alternatively, use the traditional "Player X Wins Point" buttons for simple scoring

  7. The application will automatically handle scoring according to tennis rules:

    • Points: 0, 15, 30, 40, Deuce, Advantage
    • Games: First to win 4 points with a 2-point lead
    • Sets: First to win 6 games with a 2-game lead
  8. Visit the "Match History" page to view all previously created matches

Project Structure

  • app.py: Main Flask application with game logic
  • models.py: Database models for persistent storage
  • templates/: HTML templates
  • static/css/: CSS stylesheets
  • static/js/: JavaScript files
  • requirements.txt: Python dependencies

Tennis Scoring Rules

This app implements standard tennis scoring:

  • A player must win by at least 2 points at the game level
  • A game is won by the first player to win 4 points with a 2-point lead
  • A set is won by the first player to win 6 games with a 2-game lead
  • Deuce occurs when both players have 3 points (40-40)
  • Advantage is awarded to the player who wins the point after deuce
  • Serving rules:
    • The first serve of the match is by Player 1
    • The serve alternates after each point
    • Only the serving player can score an Ace or commit a Fault
    • Two consecutive faults result in a Double Fault, awarding the point to the opponent

License

This project is open source and available under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages