Skip to content

Instantly share code, notes, and snippets.

@lfaoro
Created September 10, 2014 08:55
Show Gist options
  • Save lfaoro/9abdb6afad08c9d2c6f3 to your computer and use it in GitHub Desktop.
Save lfaoro/9abdb6afad08c9d2c6f3 to your computer and use it in GitHub Desktop.
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