Skip to content

tic-tac-toe javascript, with dynamic render, and dynamic line to win

Notifications You must be signed in to change notification settings

hoanggbao00/dynamic-tic-tac-toe-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dynamic-tic-tac-toe-js

tic-tac-toe javascript (with dynamic render, and dynamic line to win)

Replace old check win function - which is check same as size of dimension (boardSize) with new check win function

Idea

Idea Function: Start from where last move is, then check below situations

  • Check Horizontal: check left and right with col±1
  • Check Vertical: check up and down with row±1
  • Check Diagonal: with UP-LEFT (row-1/col-1) & DOWN-RIGHT (row+1/col+1)
  • Check Reverse Diagonal: with DOWN-LEFT (row+1/col-1) & UP-RIGHT (row-1/col+1)

Test

By open game.js then change the below variable to test change

  • dimension: boardSize (ex: 5 is 5x5 board)
  • winLine: line to win (ex: 3, just need 3 line nearby to win)

About

tic-tac-toe javascript, with dynamic render, and dynamic line to win

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published