Last active
March 22, 2022 10:09
-
-
Save marcel-ploch/761ab417a87712ab538497f1f5eef816 to your computer and use it in GitHub Desktop.
traficlight
This file contains 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
class TrafficLight { | |
static String updateLight(String currentState) { | |
return "Solution"; | |
} | |
} | |
void main() { | |
assert(TrafficLight.updateLight("green") == "yellow", | |
"Not correct answer for green"); | |
print("Color is yellow"); | |
assert(TrafficLight.updateLight("yellow") == "red", | |
"Not correct answer for yellow"); | |
print("Color is red"); | |
assert( | |
TrafficLight.updateLight("red") == "green", "Not correct answer for red"); | |
print("Color is green"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment