Answers for "how to check if every element in array is true c#"

C#
0

how to check if every element in array is true c#

private bool noBricksLeft () {
    for (int i = 0; i < brick.GetLength(0); i++) {
        // inverted your condition; we can short-circuit
        // and just return false
        if (brickLocation[i, 2] != 0)
            return false;
    }
    // every brick passed our condition, so return true
    return true;
}
Posted by: Guest on January-08-2021

Code answers related to "how to check if every element in array is true c#"

C# Answers by Framework

Browse Popular Code Answers by Language