TicTacToe - 0.1.0

Logic.Game

Description

Tic-tac-toe is a paper-and-pencil game for two players who take turns marking the spaces in a three-by-three grid with X or O. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row is the winner. It is a solved game, with a forced draw assuming best play from both players.

Definitions

import Logic.Extra open public

import Logic.Board open public

import Logic.GameState open public

checkState : GameState GameStateSource#

Checks if we reached the end of the game.

playMove : Maybe Nat GameState GameStateSource#

Given a player attempted move, updates the state accordingly.

validMove (n : Nat) : Maybe NatSource#

Returns just if the given Nat is in range of 1..9