16 lines
285 B
Swift
16 lines
285 B
Swift
public enum Color: UInt8, CustomStringConvertible {
|
|
case Black = 0
|
|
case White = 1
|
|
|
|
public var description: String {
|
|
return switch self {
|
|
case .Black: "b"
|
|
case .White: "w"
|
|
}
|
|
}
|
|
|
|
public static prefix func ! (rhs: Self) -> Self {
|
|
return rhs == .White ? .Black : .White
|
|
}
|
|
}
|