25 lines
632 B
Swift
25 lines
632 B
Swift
//
|
|
// Win.swift
|
|
// TTTKit
|
|
//
|
|
// Created by Shadowfacts on 12/21/22.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Win {
|
|
public let mark: Mark
|
|
public let points: [(column: Int, row: Int)]
|
|
|
|
static let allPoints: [[(Int, Int)]] = [
|
|
[(0, 0), (1, 1), (2, 2)], // top left diag
|
|
[(2, 0), (1, 1), (0, 2)], // top right diag
|
|
[(0, 0), (1, 0), (2, 0)], // top row
|
|
[(0, 1), (1, 1), (2, 1)], // middle row
|
|
[(0, 2), (1, 2), (2, 2)], // bottom row
|
|
[(0, 0), (0, 1), (0, 2)], // left col
|
|
[(1, 0), (1, 1), (1, 2)], // middle col
|
|
[(2, 0), (2, 1), (2, 2)], // right col
|
|
]
|
|
}
|