Skip to content

Instantly share code, notes, and snippets.

View Ged2323's full-sized avatar

Gerard Ged2323

View GitHub Profile
@berikv
berikv / tictactoe.swift
Last active November 11, 2022 16:16
A TicTacToe game written with SwiftUI, works in Xcode 11.0 beta Playground
import PlaygroundSupport
import SwiftUI
// MARK: - Game
extension TicTacToe.Board {
var hasNonEmptyCells: Bool {
self.flatMap { $0 }
.contains(where: { $0 != .empty })
}