I have two arrays
var Status: [Int] = [0,1,0,1,1] //which will contain at random a 0 or 1 at all five index
var Total: [Int] = [0,85,90,90,0] //which will contain any positive Int at all five index
I want to write a func that will scan Status and return only the indexes which contain a 1.
Then scan Total at these same indexes to see if the Ints are equal
In this case indexes 1,3,4 would be returned from Status scan, and Total would be scanned at [1,3,4] to return 85,90,0.
So something like this if I could come up with the correct syntax
var Status: [Int] = [0,1,1,1,1]
var Total: [Int] = [3,4,16,2,3]
var IndexesToCompare: [Int] = [Int]()
Status.scan for value '1', return indexes to IndexesToCompare
var TotalsToCompare: [Int] = [Int]()
Total.scan @Index[IndexesToCompare], return values to TotalsToCompare
if TotalsToCompare.scanIfAllIntegarsAreEqual == true {println("EQUAL")} else {println("Unequal")}
This would print out "Unequal", but if Status were changed to [1,0,0,0,1] it would print out "EQUAL"