在网上下的源码就这点改不过来,不知道怎么改
func getMoveScore(direction: MoveDirection) -> Int {
// Prepare the generator closure
let coordinateGenerator: (Int) -> [(Int, Int)] = { (iteration: Int) -> [(Int, Int)] in
let buffer = Array<(Int, Int)>(count:self.dimension, repeatedValue: (0, 0))
for i in 0..<self.dimension {
switch direction {
case .Up: buffer[i] = (i, iteration)//类型不对
case .Down: buffer[i] = (self.dimension - i - 1, iteration)//类型不对
case .Left: buffer[i] = (iteration, i)//类型不对
case .Right: buffer[i] = (iteration, self.dimension - i - 1)//类型不对
}
}
return buffer
}
func getMoveScore(direction: MoveDirection) -> Int {
// Prepare the generator closure
let coordinateGenerator: (Int) -> [(Int, Int)] = { (iteration: Int) -> [(Int, Int)] in
let buffer = Array<(Int, Int)>(count:self.dimension, repeatedValue: (0, 0))
for i in 0..<self.dimension {
switch direction {
case .Up: buffer[i] = (i, iteration)//类型不对
case .Down: buffer[i] = (self.dimension - i - 1, iteration)//类型不对
case .Left: buffer[i] = (iteration, i)//类型不对
case .Right: buffer[i] = (iteration, self.dimension - i - 1)//类型不对
}
}
return buffer
}
解决方案 »
- 各位哥哥目前IOS在国内前景如何?
- NSString的drawInRect方法怎么样获得文字的高度
- xcode 4.3.2 里面没有windows base application
- ipad文件读写权限问题
- 如何在iphone上实现类似MFC中消息机制?
- 为何图片显示不正常?
- xcode 如何将wchar_t设置成2字节 现在默认sizeof(wchar_t)=4
- 怎么去掉NavigationBar 底部的黑线
- iOS MKMapView地图,大头针坐标在国内显示正常,而到了国外显示坐标偏掉了,为什么呢?
- 利用 runtime,解决多次点击相同 button,导致重复跳转的问题
- ARC 下 我怎么样能主动释放内存
- 【关于用户没有打开APP时】信息推送提醒问题
var buffer = Array<(Int, Int)>(count:self.dimension, repeatedValue: (0, 0))