Skip to content

ifnowcode/ox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

❌⭕ Adjustable Tic-Tac-Toe

https://ifnowcode.github.io/ox

Adjustable Tic-Tac-Toe is a flexible, grid-based variant of the classic game. Instead of being limited to a 3×3 board, players can choose any board size and win condition, making the game more strategic and replayable.


🎮 Features

  • Adjustable board size (3×3, 4×4, 5×5, or larger)

  • Custom win length (3-in-a-row, 4-in-a-row, etc.)

  • Player vs Player or Player vs AI

  • Simple, clean UI

  • Snap-to-grid input

  • Win detection for any board size

  • Optional highlight of winning line


🧠 How It Works

  • Players alternate placing X and O on the grid.

  • The first player to achieve the configured number of consecutive marks wins.

  • The game automatically detects:

    • Horizontal wins

    • Vertical wins

    • Diagonal wins

    • Anti-diagonal wins

  • Draws are detected when the board is full.


⚙️ Customization Options

  • Board Size: Choose the number of rows/columns

  • Win Condition: Set how many in a row are required

  • AI Difficulty: Simple or more advanced heuristics

  • Symbols: Choose from classic X/O or emoji sets


🖥️ Technical Notes

  • Built using HTML5 canvas for smooth rendering

  • Grid and pieces drawn dynamically based on board size

  • Win detection uses scalable scanning logic

  • Clean separation of:

    • Rendering

    • Input

    • Game state

    • AI logic


🚀 Future Enhancements

  • Smarter AI (minimax or Monte Carlo)

  • Animated piece placement

  • Online multiplayer

  • Theme packs (neon, retro, emoji sets)

About

Tic Tac Toe

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors