{"id":27108743,"url":"https://github.com/root-tester/tic-tac-toe","last_synced_at":"2025-07-09T06:07:55.455Z","repository":{"id":280226698,"uuid":"941352032","full_name":"Root-Tester/Tic-Tac-Toe","owner":"Root-Tester","description":"Looking for a quick game? Play Tic-Tac-Toe online! Challenge your friends or test your skills against our AI. Enjoy endless rounds of this classic favorite.","archived":false,"fork":false,"pushed_at":"2025-04-01T06:45:40.000Z","size":902,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T22:39:09.856Z","etag":null,"topics":["css-grid","css3","html5","javascript","tic-tac-toe","tic-tac-toe-game","tictactoe","tictactoe-game"],"latest_commit_sha":null,"homepage":"https://root-tester.github.io/Tic-Tac-Toe/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Root-Tester.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-02T04:37:00.000Z","updated_at":"2025-04-01T06:45:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"f9cce7dd-e6df-4816-8a78-f26d9003ebb2","html_url":"https://github.com/Root-Tester/Tic-Tac-Toe","commit_stats":null,"previous_names":["root-tester/tic-tac-toe"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Root-Tester/Tic-Tac-Toe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Root-Tester%2FTic-Tac-Toe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Root-Tester%2FTic-Tac-Toe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Root-Tester%2FTic-Tac-Toe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Root-Tester%2FTic-Tac-Toe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Root-Tester","download_url":"https://codeload.github.com/Root-Tester/Tic-Tac-Toe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Root-Tester%2FTic-Tac-Toe/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264403799,"owners_count":23602621,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css-grid","css3","html5","javascript","tic-tac-toe","tic-tac-toe-game","tictactoe","tictactoe-game"],"created_at":"2025-04-06T22:34:58.378Z","updated_at":"2025-07-09T06:07:55.432Z","avatar_url":"https://github.com/Root-Tester.png","language":"HTML","readme":"\u003c!-- !\n * Palindrome Checker Web App\n * Copyright (c) 2025 Tushar Kumar Sahu\n * Licensed under the Apache License 2.0\n * See LICENSE file for more information.\n * http://www.apache.org/licenses/LICENSE-2.0\n --\u003e\n# Tic Tac Toe Game \n\n## Introduction\n\n  Tic Tac Toe is a classic two-player game where players alternate marking spaces in a 3x3 grid. The objective is to place three of your marks (either \"X\" or \"O\") in a horizontal, vertical, or diagonal row before your opponent does.\n\n## Features\n\n- **Two-player Mode:** Players can take turns to play as \"X\" or \"O.\"\n- **AI Mode:** Play against a computer opponent, with the AI making moves based on predefined logic.\n- **Win Detection:** The game automatically checks for a winner after each move, detecting horizontal, vertical, and diagonal winning conditions.\n- **Tie Detection:** If all spaces on the board are filled and no player has won, the game ends in a tie.\n- **Reset Option:** The game provides an option to reset the board and start a new game.\n- **Intuitive User Interface:** The game is easy to play with simple click/tap interactions.\n\n## Game Rules\n- Players alternate turns.\n- Player 1 is assigned \"X\" and Player 2 is assigned \"O.\"\n- A player wins by getting three of their marks in a row (either horizontally, vertically, or diagonally).\n- The game ends in a tie if the board is full and no player has won.\n- After a win or tie, the game will prompt players to restart after click the window.\n\n\n## Gameplay\n\n### 1. Starting a Game:\n   - Upon launching the game, the player need to select the mode 2 player mode or Vs. Computer (if he want to play with ai). After this the 3x3 grid will be displayed.\n   - Player 1 will go first and place \"X\" on the grid.\n  ### 2. Making a Move:\n   - Players click on an empty cell to place their mark (either \"X\" or \"O\").\n   - The game will check if the move results in a win or tie.\n  ### 3. Winning the Game:\n   - The game will check if any player has succeeded in getting three marks in a row after each move.\n   - If a player wins, the game will display a message announcing the winner.\n  ### 4. Tie Game:\n   - If all cells are filled and no player has won, the game will announce a tie.\n  ### 5. Restarting the Game:\n   - After a game concludes, the player needs to tap or click any key to restart the game, resetting the grid for a new game.\n\n     \n\n## Technical Details\n\n### Game Logic\n  The game checks for a win or tie after every move by:\n\n  - Checking all rows, columns, and diagonals for three identical marks.\n  - If a player places their mark in a winning position, the game ends and declares the winner.\n  - If all cells are filled without a winner, the game ends in a tie.\n\n\n### User Interface (UI)\n\n3x3 Grid: The board consists of 9 cells, with each cell initially empty.\n- **Buttons:** Players can click on any empty cell to place their mark.\n- **Messages:** After each game, the UI displays whether the game was won or tied.\n- **Responsive Layout:** The game layout dynamically adjusts based on the screen size, ensuring optimal playability on any device.\n\n### Technologies Used\n\n- **index.html:** Contains the structure of the game, including the 3x3 grid container where the JavaScript dynamically generates the grid.\n- **styles.css:** Defines the layout and appearance, including the responsive design rules for different screen sizes.\n- **script.js:** Contains the logic for dynamically creating the game board, player moves, AI behavior, win/tie detection, and restarting the game.\n\n\n## License\n\nThis project is licensed under the Apache License 2.0. You are free to use, modify, and distribute the code with the following conditions:\n\n-  You must not copy the entire project and display it as your own.\n\n-  You must include the original license and give credit to the authors.\n\n-  If you modify the code, you must provide a clear notice of the changes.\n\nFor full license details, visit the [Apache License 2.0](LICENSE)\n\n\n## Contributing\n\nFeel free to contribute! To contribute:\n\n1. Fork the repository.\n\n2. Create a new branch for your changes.\n\n3. Make your changes.\n\n4. Open a pull request.\n\nWe appreciate your contributions!\n\n## Demo\n\nYou can check out a live demo of this Tic-Tac-Toe game [here](https://root-tester.github.io/Tic-Tac-Toe/Tic-Tac-Toe).\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froot-tester%2Ftic-tac-toe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froot-tester%2Ftic-tac-toe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froot-tester%2Ftic-tac-toe/lists"}