Skip to content

xuyuji9000/tttengine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tttengine

tic tac toe game engine. This work as a js library.

Functions

board.chooseRole(v)

Use this function to define which player do you want to choose. You can choose 'x' or 'o'.

board.move(i)

Use this function to define the next move you want to take. 'i' should between 1~9. Although engine will not allow you cover ocuppied shape, try not to be dummy.

board.getStatus()

Use this function to get the status of the board. It will return an array which be like ["o", "o", "-", "-", "-", "x", "x", "-", "-"].

board.isEnd()

Use this function to check if the game is end.

Thanks

Tic Tac Toe front-end framework by the courtesy of Ricky.