A TicTacToe game using ReactJS and Rails
I use a matrix of powers of two to determine a winner:
1 2 4
8 16 32
64 128 256
If the Bitwise-AND of any special winner numbers and players sum is the winner number then this player is the winner of the game.
A special winner number is just a sum of horizontal, vertical, or diagonal rows — the condition to win TicTacToe game.
- TicTacToe
- GameField
- CurrentPlayer
- Matrix
- Cells
- PlayersForm
- Winner
- Leaderbord
Application uses sqlite 3 as a database
rake db:create
rake db:schema:load
bin/rails s
bin/rspec