Skip to content

aroan-v/Tic-Tac-Toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic Tac Toe Project Overview

Explore this Tic-Tac-Toe project, a strategic, interactive game designed for competitive players, offering a smart computer AI opponent with selectable difficulty levels. Built with functional design principles, this game is structured to evolve seamlessly from console-only to full DOM interactivity. Key functions include move analysis, strategic decision-making, and a flexible evaluation system for enhanced gameplay.

Key Features

  • Game Mechanics: Enables players to engage in turn-based Tic-Tac-Toe matches, with win/loss evaluation, tie conditions, and move history tracking through console.log.
  • AI Opponent: A function-based AI that adapts to player actions with varied difficulty modes for balanced challenges.
  • Move Evaluation System: Real-time move analysis to recognize potential winning moves and blocks, ensuring strategic gameplay.
  • Difficulty Adjustments: Allows players to choose difficulty levels, affecting the computer’s strategic depth.
  • Transition to UI: Structured for future UI expansion using modular DOM manipulation functions.
  • Symbol Switching: Players switch between 'X' and 'O' each round, with 'X' always moving first, offering a fair start for both players.

Constraints

  • PvP functionality has not yet been implemented.
  • The overall code could benefit from improved clarity and organization.
  • The ability to change the user’s avatar has not been integrated yet.

Additional Concepts Explored

  • Utilization of closures within functions.
  • Enhancing code efficiency by employing .querySelectorAll() followed by .classList.contains() to filter through DOM elements.
  • Implementing delays for animations, announcements, and similar features using setTimeout().
  • In-depth exploration of various array methods and proper chaining to determine the best options for both readability and maintaining code efficiency.
  • Extended study of how to manipulate objects and access their properties with bracket notation.

Applications Used

  • Visual Studio Code
  • Figma for future UI and UX designs
  • Git and GitHub for version control and collaboration
  • Console and CodePen.io for prototyping and testing logic functions

Author

aroan-v

Credits

Special thanks to The Odin Project and its community for the support throughout this journey.