Skip to content

Latest commit

 

History

History
132 lines (102 loc) · 4.35 KB

README.template.md

File metadata and controls

132 lines (102 loc) · 4.35 KB

<% authorGithubUsername = authorGithubUsername ? authorGithubUsername : "ingles98" -%> <% projectPrerequisites = projectPrerequisites && projectPrerequisites.length ? projectPrerequisites : [ {name: "Node", value: "v15.2.1"}, {name: "NPM", value: "v7.0.8"}, ] -%>

🕹 TicTac-Node ❌ | ⭕️ |

<% if (isProjectOnNpm) { -%> Version <% } -%> <% if (projectVersion && !isProjectOnNpm) { -%> Version <% } -%> <% if (projectPrerequisites) { -%> <% projectPrerequisites.map(({ name, value }) => { -%> <% }) -%> <% } -%> <% if (projectDocumentationUrl) { -%> Documentation <% } -%> <% if (isGithubRepos) { -%> Maintenance <% } -%> <% if (licenseName) { -%> License: <%= licenseName %> <% } -%> <% if (authorTwitterUsername) { -%> Twitter: <%= authorTwitterUsername %> <% } -%>

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.

<% if (projectHomepage) { -%>

<% } -%> <% if (projectDemoUrl) { -%>

Demo

<% } -%> <% if (projectPrerequisites && projectPrerequisites.length) { -%>

Prerequisites

<% projectPrerequisites.map(({ name, value }) => { -%>

  • <%= name %> <%= value %> <% }) -%> <% } -%>

Install

npm i git+https://github.com/ingles98/tictac-node

Usage

//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
}

Run tests

(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

Documentation

Everything (mostly?) is documented and the documentation has been generated to the docs folder.

<% if (authorName || authorTwitterUsername || authorGithubUsername) { -%>

Author

<% if (authorName) { %> 👤 <%= authorName %> <% } %> <% if (authorWebsite) { -%>

  • Website: <%= authorWebsite %> <% } -%> <% if (authorTwitterUsername) { -%>
  • Twitter: [@<%= authorTwitterUsername %>](https://twitter.com/<%= authorTwitterUsername %>) <% } -%> <% if (authorGithubUsername) { -%>
  • GitHub: [@<%= authorGithubUsername %>](https://github.com/<%= authorGithubUsername %>) <% } -%> <% if (authorLinkedInUsername) { -%>
  • LinkedIn: [@<%= authorLinkedInUsername %>](https://linkedin.com/in/<%= authorLinkedInUsername %>) <% } -%> <% } -%> <% if (issuesUrl) { -%>

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page. <%= contributingUrl ? You can also take a look at the [contributing guide](${contributingUrl}). : '' %> <% } -%>