Created
September 10, 2014 08:55
-
-
Save lfaoro/9abdb6afad08c9d2c6f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Shape { | |
case K, Q, B, R, N, P | |
static let allValues = [K, Q, B, R, N, P] | |
} | |
enum Color { | |
case w, b | |
static let allValues = [w, b] | |
} | |
struct Piece { | |
var color: Color | |
var shape: Shape | |
func getRawPiece(color: Piece, shape: Piece) -> String { | |
return String(color + shape) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment