-type Pos =
- { i: int; j: int }
- member this.Next : Pos option =
- match this with
- | { i = 8; j = 8 } -> None
- | { i = i; j = 8 } -> Some { i = i + 1; j = 0 }
- | { i = _; j = j } -> Some { this with j = j + 1 }
-
-let zoneRange c =
+[<Struct>]
+type Pos (i: int, j: int) =
+ member this.I = i
+ member this.J = j
+ member this.Next : Pos option =
+ match this.I, this.J with
+ | 8, 8 -> None
+ | _, 8 -> Some (Pos(this.I + 1, 0))
+ | _ -> Some (Pos(this.I, this.J + 1))
+ override this.ToString() =
+ sprintf "Pos(i = %i, j = %i)" this.I this.J
+
+let zoneRange c =