var card:[[Int]] = bank[numberOfMarked].card;
if ((card[0][0] == 0) && (card[1][1] == 0) && (card[2][2] == 0) && (card[3][3] == 0) && (card[4][4] == 0))
{
return true;
}
我收到错误"找不到会员'下标'并且编译器指向最后一个&&。
答案 0 :(得分:0)
我file a bug - 我也遇到了这个错误:note: expression was too complex to be solved in reasonable time; consider breaking up the expression into distinct sub-expressions
。该表达式没有错,但是现在要在Swift中使用它,你需要将它分解为几个Bool
变量:
let firstTwo = card[0][0] == 0 && card[1][1] == 0
let lastThree = card[2][2] == 0 && card[3][3] == 0 && card[4][4] == 0
if firstTwo && lastThree {
return true
}