-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Karl Yogi
authored and
Karl Yogi
committed
Aug 5, 2016
1 parent
cbefb63
commit 2d09028
Showing
2 changed files
with
11 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
# tttengine | ||
tic tac toe game engine. This work as a js library. | ||
|
||
# Jobs | ||
- maintain the game logic, like this is A's turn, then B's turn. | ||
- check player's move is legitimate | ||
- web appearance callback | ||
|
||
# Functions | ||
chooseRole(v) | ||
## 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. | ||
|
||
move(i) | ||
## board.getStatus() | ||
Use this function to get the status of the board. It will return an array which be like ["o", "o", "-", "-", "-", "x", "x", "-", "-"]. | ||
|
||
getWinner() | ||
## board.isEnd() | ||
Use this function to check if the game is end. | ||
|
||
# Thanks | ||
Tic Tac Toe front-end framework by the courtesy of Ricky. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters