swift - Compiler error: could not find member 'subscript' with && -
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 getting error "could not find member 'subscript' , compiler pointing last &&.
i'd file bug -- i'm getting error well: note: expression complex solved in reasonable time; consider breaking expression distinct sub-expressions
. nothing wrong expression, use in swift right you'll need break 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 }
Comments
Post a Comment