TicTacToe 1.1.0

Tic Tac Toe Library

The best and first open source library for the logic of Tic Tac Toe game, with Test project.

Install-Package TicTacToe -Version 1.1.0
dotnet add package TicTacToe --version 1.1.0
<PackageReference Include="TicTacToe" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TicTacToe --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Tic Tac Toe Library

The best and first open-source library for the logic of the Tic Tac Toe game.
Easy to use, with test/example project on GitHub Repositority

How to start a new game instance?

Just create a new instance of the TicTacToe class.
TicTacToeInstance ttt = new TicTacToeInstance();

How can I get current board info?

The board is a property of the TicTacToeInstance class.
It called BoardState, and it's array of array of BoardStateOption enum which can be Undefined if nothing in this field, X if the X player selected it, or O if the O player selected it. Full example of the BoardState is: ttt.BoardState[0][1], in this example we are getting the second column in the first row.

Can I change the board state as I want

No, you can't.

O'k, the player know where he want to put, what to do?

ttt.MakeOperation(row, column);, indexes base-zero.
This will return null if the game isn't finished or WinnerOption if the game finished.
WinnerOption can be: X, O, Tie

The game is finished, what's next?

Nothing, you can kill this instance, you can't do anything else.

Tic Tac Toe Library

The best and first open-source library for the logic of the Tic Tac Toe game.
Easy to use, with test/example project on GitHub Repositority

How to start a new game instance?

Just create a new instance of the TicTacToe class.
TicTacToeInstance ttt = new TicTacToeInstance();

How can I get current board info?

The board is a property of the TicTacToeInstance class.
It called BoardState, and it's array of array of BoardStateOption enum which can be Undefined if nothing in this field, X if the X player selected it, or O if the O player selected it. Full example of the BoardState is: ttt.BoardState[0][1], in this example we are getting the second column in the first row.

Can I change the board state as I want

No, you can't.

O'k, the player know where he want to put, what to do?

ttt.MakeOperation(row, column);, indexes base-zero.
This will return null if the game isn't finished or WinnerOption if the game finished.
WinnerOption can be: X, O, Tie

The game is finished, what's next?

Nothing, you can kill this instance, you can't do anything else.

Release Notes

If this is your first time using this library, check the Test project on the GitHub (Project URL).
Fixed bugs from the previous version. Added XTurn variable, after MakeOperation it changes it's state.

Dependencies

This package has no dependencies.

Version History

Version Downloads Last updated
1.1.0 293 5/27/2018
1.0.0 251 4/12/2018