More than just a tic tac toe game.
This project is more of a demo for code quality, readability, documentation, modularity and so on...
It includes a UI implementation that lets you play the game using command line, but by implementing ITicTacUI you're able to use this package to make a tictactoe webserver, or anything else really.
I intend on implementing an example of a web UI using Vue+Express and maybe multiplayer as well.
Tic Tac Toe is simple but there's many things you can work on using it as a foundation to train yourself.
- Node v15.2.1
- NPM v7.0.8
npm i git+https://github.com/ingles98/tictac-node
//examples/run_cli.ts
import TicTacNode from 'tictac-node'
while (true) {
console.clear()
const game = new TicTacNode.Core.TicTacToe(new TicTacNode.UI.CLI())
game.start( TicTacNode.UI.CLI.promptBoolean("Versus AI?", undefined) )
if (!TicTacNode.UI.CLI.promptBoolean("Start a new game?"))
break
}
(TODO: Actually implement tests)
Using JEST. I personally recommend using the vscode-jest extension on Visual Studio Code if you use it.
npm run test
Everything (mostly?) is documented and the documentation has been generated to the docs
folder.
👤 Filipe Reis
- Website: http://filipereis.atwebpages.com/
- GitHub: @ingles98
Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.