{"id":24201658,"url":"https://github.com/ramazancetinkaya/tictactoe","last_synced_at":"2025-09-22T00:31:42.950Z","repository":{"id":208675201,"uuid":"722163161","full_name":"ramazancetinkaya/tictactoe","owner":"ramazancetinkaya","description":"A simple Tic Tac Toe game built using HTML, CSS, and JavaScript. This project allows players to enjoy the classic game in Player vs Player or Player vs AI mode.","archived":false,"fork":false,"pushed_at":"2025-08-29T13:43:27.000Z","size":38,"stargazers_count":82,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-29T15:59:44.914Z","etag":null,"topics":["css","html","javascript","javascript-game","minimax-algorithm","tic-tac-toe","tictactoe","tictactoe-game"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ramazancetinkaya.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-11-22T15:11:42.000Z","updated_at":"2025-08-29T13:55:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"9938633c-c779-44de-94e2-63928c3c2cad","html_url":"https://github.com/ramazancetinkaya/tictactoe","commit_stats":null,"previous_names":["ramazancetinkaya/tictactoe"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ramazancetinkaya/tictactoe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramazancetinkaya%2Ftictactoe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramazancetinkaya%2Ftictactoe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramazancetinkaya%2Ftictactoe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramazancetinkaya%2Ftictactoe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ramazancetinkaya","download_url":"https://codeload.github.com/ramazancetinkaya/tictactoe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramazancetinkaya%2Ftictactoe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276328924,"owners_count":25623323,"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","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","html","javascript","javascript-game","minimax-algorithm","tic-tac-toe","tictactoe","tictactoe-game"],"created_at":"2025-01-13T21:16:38.114Z","updated_at":"2025-09-22T00:31:42.913Z","avatar_url":"https://github.com/ramazancetinkaya.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tic-Tac-Toe Game\n\n\u003cp align=\"center\"\u003e\n  \u003c!-- License --\u003e\n  \u003ca href=\"https://github.com/ramazancetinkaya/tictactoe/blob/main/LICENSE\"\u003e\n    \u003cimg alt=\"License\" src=\"https://img.shields.io/badge/license-MIT-009688.svg?style=for-the-badge\"\u003e\n  \u003c/a\u003e\n  \u003c!-- Issues --\u003e\n  \u003ca href=\"https://github.com/ramazancetinkaya/tictactoe/issues\"\u003e\n    \u003cimg alt=\"GitHub Issues\" src=\"https://img.shields.io/github/issues/ramazancetinkaya/tictactoe?color=F44336\u0026style=for-the-badge\"\u003e\n  \u003c/a\u003e\n  \u003c!-- Stars --\u003e\n  \u003ca href=\"https://github.com/ramazancetinkaya/tictactoe/stargazers\"\u003e\n    \u003cimg alt=\"GitHub Stars\" src=\"https://img.shields.io/github/stars/ramazancetinkaya/tictactoe?color=FFEB3B\u0026style=for-the-badge\"\u003e\n  \u003c/a\u003e\n  \u003c!-- Forks --\u003e\n  \u003ca href=\"https://github.com/ramazancetinkaya/tictactoe/network\"\u003e\n    \u003cimg alt=\"GitHub Forks\" src=\"https://img.shields.io/github/forks/ramazancetinkaya/tictactoe?color=2196F3\u0026style=for-the-badge\"\u003e\n  \u003c/a\u003e\n  \u003c!-- Version --\u003e\n  \u003cimg alt=\"Version\" src=\"https://img.shields.io/badge/version-1.0.0-673AB7.svg?style=for-the-badge\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003c!-- Languages --\u003e\n  \u003cimg alt=\"HTML\" src=\"https://img.shields.io/badge/HTML-5-FF5722.svg?style=for-the-badge\"\u003e\n  \u003cimg alt=\"CSS\" src=\"https://img.shields.io/badge/CSS-3-3F51B5.svg?style=for-the-badge\"\u003e\n  \u003cimg alt=\"JavaScript\" src=\"https://img.shields.io/badge/JavaScript-ES6-FFC107.svg?style=for-the-badge\"\u003e\n\u003c/p\u003e\n\n## Overview\n\nA classic Tic-Tac-Toe game built with a modern, responsive design and a focus on a pure vanilla JavaScript, HTML, and CSS stack. Challenge yourself against a custom-built AI with three distinct difficulty levels, designed to provide a fun and challenging experience without relying on external frameworks.\n\n## Demo\n\nView the live demo on GitHub Pages:\n\n[![Demo](https://img.shields.io/badge/Demo-Live_on_GitHub_Pages-blue?style=for-the-badge\u0026logo=github\u0026logoColor=white)](https://ramazancetinkaya.github.io/tictactoe/)\n\n## Features\n\n- Human vs. Computer(CPU)\n- 3 AI Difficulty Levels (Easy, Medium, Hard)\n- Player Symbol Selection (X or O)\n- Fully Responsive Design (Mobile, Tablet, Desktop)\n- Session Score and Tie Tracking\n- Variable AI Move Delay for Realistic Pacing\n\n### A closer look at AI movements\n\nThe AI was developed without using the traditional Minimax algorithm. Instead, it relies on a heuristic-based expert system that evaluates the game state based on a clear hierarchy of strategic priorities.\n\n### Hard Level\nThe \"Hard\" AI acts as a near-perfect opponent by following a deterministic priority list for its moves:\n1.  **Win:** If it has an immediate winning move, it takes it.\n2.  **Block:** If the player has an immediate winning move, it blocks it.\n3.  **Fork:** It looks for opportunities to create two winning threats simultaneously.\n4.  **Block Fork:** It identifies and blocks the opponent's potential forking moves.\n5.  **Control Strategic Positions:** It prioritizes taking the center, then opposite corners, and finally any remaining corners before defaulting to side positions.\n\n### Medium Level\nThis AI uses a subset of the \"Hard\" AI's logic (Win, Block, Center Control) but introduces **probabilistic error injection**. There is a calculated chance (~25%) on each turn that it will ignore the optimal move and instead choose a random, often suboptimal, one. This simulates a skilled player who is prone to making occasional mistakes.\n\n### Easy Level\nThe \"Easy\" AI is primarily a **reactive and defensive** agent. Its main priority is to block the player from winning. It only rarely checks for its own winning opportunities and will otherwise make random moves, simulating a beginner player.\n\n## Screenshots\n\n\u003cdiv align=\"center\"\u003e\n\n| Main Menu Screenshot |\n| :---: |\n| ![Tic-Tac-Toe game main menu](./tictactoe-screenshots/tictactoe-mainmenu.png) |\n\n\u003c/div\u003e\n\n## Installation and Usage\n\n### Option 1: Git Clone\n\nIf you have Git installed, use the following command to clone the repository:\n\n```bash\ngit clone https://github.com/ramazancetinkaya/tictactoe.git\n```\n\nNavigate to the project directory:\n\n```bash\ncd tictactoe\n```\n\nOpen `index.html` in your web browser to use the application.\n\n### Option 2: ZIP Download\n\n1. Visit the repository at `https://github.com/ramazancetinkaya/tictactoe`\n2. Click the \"Code\" button\n3. Select \"Download ZIP\" from the dropdown menu\n4. Extract the ZIP file to your preferred location\n5. Open the extracted folder\n6. Open `index.html` in your web browser to use the application\n\n## How to Play\n\n1.  **Choose Your Mark:** Select whether you want to play as `X` or `O`.\n2.  **Select Difficulty:** Pick a difficulty level for the AI opponent: `Easy`, `Medium`, or `Hard`.\n3.  **Start the Game:** Click the \"New Game\" button to begin.\n4.  **Make Your Move:** Click on any empty square on the board to place your mark.\n5.  **Goal:** Be the first to get three of your marks in a row—horizontally, vertically, or diagonally—to win the round.\n\n## Tech Stack\n\n- HTML5\n- CSS3 (Vanilla)\n- JavaScript (ES6+, Vanilla)\n- Bootstrap Icons\n\n## Browser Compatibility\n\nTested and working on:\n- Chrome (latest)\n- Firefox (latest)\n- Safari (latest)\n- Edge (latest)\n- Mobile browsers (iOS Safari, Android Chrome)\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bug fixes.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n\n```\nMIT License\n\nCopyright (c) 2025 Ramazan Çetinkaya\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n\n## Author\n\nDeveloped and designed by **Ramazan Çetinkaya**\n- GitHub: [ramazancetinkaya](https://github.com/ramazancetinkaya)\n\n## Acknowledgements\n\n- Special thanks to the open-source community for inspiration\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framazancetinkaya%2Ftictactoe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framazancetinkaya%2Ftictactoe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framazancetinkaya%2Ftictactoe/lists"}