当我突然出现错误时,我正在按照快速教程进行操作,我已经完全按照YouTube上的人员编写了代码。
如果您知道如何修复错误,我真的很感激。
(:来自一位13岁的程序员。
var plays = Dictionary<Int,Int>()
var done = false
var aiDeciding = false
@IBAction func UIButtonClicked(sender:UIButton) {
if plays[sender.tag] == nil && !aiDeciding && !done {
setImageForSpot(sender.tag, player:1)
}
checkForWin()
aiTurn()
}
func setImageForSpot(spot:Int,player:Int) {
}
func chekForWin(){
}
func aiDeciding() {
}
func aiTurn() {
}
答案 0 :(得分:0)
您有一个名为aiDeciding
的变量和一个名称相同的函数func aiDeciding()
。它看起来像一个bug。
你在chekForWin
而不是checkForWin
打了个拼写错误。