Created
April 2, 2020 07:40
-
-
Save wizard1066/9a5fcf2100f39b8c8e63b327abd434c4 to your computer and use it in GitHub Desktop.
abpwtpF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func confirmColours(textColors:[Color],figures:Int) -> Bool? { | |
for loop in 0 ..< figures { | |
if textColors[loop] == Color.clear { | |
return false | |
} | |
} | |
var tfigures = figures - 1 | |
let rfigure = Int(Double(figures).squareRoot()) | |
for _ in 0..<rfigure { | |
var superSet = Set<String>() | |
for loop in stride(from: tfigures, to: tfigures - rfigure, by: -1) { | |
superSet.insert(textColors[loop].description) | |
print("loop ",loop) | |
} | |
tfigures = tfigures - rfigure | |
print("superSet ",superSet,superSet.count) | |
if superSet.count != rfigure { | |
alertPublisher.send() | |
} | |
} | |
tfigures = figures - 1 | |
for _ in 0..<rfigure { | |
var superSet = Set<String>() | |
for loop in stride(from: tfigures, to: -1, by: -rfigure) { | |
superSet.insert(textColors[loop].description) | |
print("loop2 ",loop) | |
} | |
tfigures = tfigures - 1 | |
print("superSet ",superSet,superSet.count) | |
if superSet.count != rfigure { | |
alertPublisher.send() | |
} | |
} | |
return true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment