Answers for "swift struct"

0

swift struct

struct Player {
    var name: String
    var highScore: Int = 0
    var history: [Int] = []

    init(_ name: String) {
        self.name = name
    }
}

var player = Player("Tomas")
Posted by: Guest on January-15-2022

Code answers related to "Swift"

Browse Popular Code Answers by Language