 // where no queen can Attack another one
 
 let result = boards()
-
-print("\(result.count) possibilities:")
-print(result)
+result.forEach { $0.prettyPrint() }

    let x: Int
    let y: Int
    
    func canAttack(x: Int, y: Int) -> Bool {
        if self.x == x || self.y == y {
            return true


extension Collection where Iterator.Element == ChessPiece {
    
    func representation(x: Int, y: Int) -> String {
        return reduce(" ") { ($1.x == x && $1.y == y) ? $1.representation : $0 }
    }
    
    func fits(x: Int, y: Int) -> Bool {
        return reduce(true) { $0 && !$1.canAttack(x: x, y: y) }
    }
    
    func prettyPrint() {
        let string = coordinates.reduce("") { board, row in
            return board + row.reduce("") { row, item in
                return row + "| \(self.representation(x: item.0, y: item.1)) "
            } + "| \r\n"
        }
        print(string)
    }
    
}
