--- This module defines the ;Symbol; type and some helper functions.
module Logic.Symbol;
import Stdlib.Prelude open;
--- A symbol represents a token that can be placed in a square
type Symbol :=
| --- The circle token
O : Symbol
| --- The cross token
X : Symbol;
--- Equality for ;Symbol;s
==Symbol : Symbol → Symbol → Bool
| O O := true
| X X := true
| _ _ := false;
--- Turns ;O; into ;X; and ;X; into ;O;
switch : Symbol → Symbol
| O := X
| X := O;
--- Textual representation of a ;Symbol;
showSymbol : Symbol → String
| O := "O"
| X := "X";
Last modified on 2023-10-06 13:21 UTC