Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum Color: String {
- case white = "белый"
- case black = "черный"
- }
- enum ChessFigures: String {
- case king = "король"
- case queen = "королева"
- case bishop = "слон"
- case knight = "конь"
- case rook = "ладья"
- case pawn = "пешка"
- }
- struct Chessmen {
- var chessFigure: ChessFigures
- var color: Color
- var coordinates: (Character, UInt)? = nil
- mutating func setCoordinates(char: Character, num: UInt) {
- self.coordinates = setCoordinates
- }
- init(chessFigure: ChessFigures, color: Color) {
- self.chessFigure = chessFigure
- self.color = color
- }
- }
- var whiteKing = Chessmen(chessFigure: .king, color: .white)
- whiteKing.coordinates = ("A",4)
- whiteKing.coordinates
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement