0
 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; 
    }

i am getting the error "Could not find member 'subscript' and the compiler is pointing to the last &&.

Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

0

I'd file a bug -- I'm getting this error as well: note: expression was too complex to be solved in reasonable time; consider breaking up the expression into distinct sub-expressions. Nothing wrong with that expression, but to use it in Swift right now you'll need to break it up into a couple Bool variables:

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
}
Nate Cook
  • 92,417
  • 32
  • 217
  • 178