Skip to content

Latest commit

 

History

History
97 lines (62 loc) · 2.55 KB

README.md

File metadata and controls

97 lines (62 loc) · 2.55 KB

Tic Tac Toe - CPU vs Player

This repository contains a simple Tic Tac Toe game where the user can play indefinitely against the CPU. The game keeps track of scores on a scoreboard and provides options to reset the game. Built using HTML, CSS, and JavaScript, this project delivers a responsive and interactive experience for players.


Features

  • Player vs CPU Gameplay: Engage in an endless Tic Tac Toe match against an AI opponent.
  • Scoreboard Tracking: The scoreboard dynamically updates and displays the scores for both the player and the CPU.
  • Reset Button: Allows the user to reset the scores and start a new game instantly.
  • Browser Refresh Behavior: Refreshing the browser resets the scores back to 0-0.
  • Responsive Design: Compatible with different screen sizes for seamless gameplay on mobile and desktop.

Technologies Used

  • HTML - Structure of the game.
  • CSS - Styling for visual appeal and responsiveness.
  • JavaScript - Game logic, AI behavior, and interactivity.

Installation

  1. Clone the repository:
  https://github.com/anirudh-singh01/Tic-Tac-Toe-Game.git
  1. Navigate to the project folder:
  cd tic-tac-toe
  1. Open the index.html file:
  open index.html

Alternatively, you can open the file in your web browser.


How to Play

  1. Open the game in your browser.
  2. Click on any empty cell to make your move.
  3. The CPU automatically makes its move after yours.
  4. Continue playing until there is a winner or the game results in a draw.
  5. The scoreboard updates based on wins, losses, and draws.
  6. Use the Reset button to clear the scores and start a new match.
  7. Refreshing the browser resets the scoreboard to 0-0.

Folder Structure

├── index.html         # Main HTML file
├── style.css          # CSS styles for layout and design
├── script.js          # JavaScript code for game logic
└── README.md          # Project documentation

Future Enhancements

  • Add different difficulty levels for the CPU.
  • Implement a multiplayer mode for two players.
  • Store scores using LocalStorage to persist data even after browser refresh.
  • Add animations and sound effects for a more engaging experience.

Contributing

Contributions are welcome! If you'd like to improve this project, feel free to fork the repository and submit a pull request.


License

This project is licensed under the MIT License.


Author

Anirudh Singh
GitHub Profile