测试
import Foundation
let NumColumns = 9
let NumRows = 9
class Level {
private var cookies = Array2D<Cookie>(columns: NumRows, rows: NumRows)
func cookieAtColumn(column: Int, row: Int) -> Cookie?{
// here assert is a c function? not sure, check on that later
// here the
assert(column >= 0 && column < NumColumns)
assert(row >= 0 && row < NumRows)
return cookies[column, row]
}
}
let NumColumns = 9
let NumRows = 9
class Level {
private var cookies = Array2D<Cookie>(columns: NumRows, rows: NumRows)
func cookieAtColumn(column: Int, row: Int) -> Cookie?{
// here assert is a c function? not sure, check on that later
// here the
assert(column >= 0 && column < NumColumns)
assert(row >= 0 && row < NumRows)
return cookies[column, row]
}
}