Skip to content

Instantly share code, notes, and snippets.

@marcel-ploch
Last active March 22, 2022 10:09
Show Gist options
  • Save marcel-ploch/761ab417a87712ab538497f1f5eef816 to your computer and use it in GitHub Desktop.
Save marcel-ploch/761ab417a87712ab538497f1f5eef816 to your computer and use it in GitHub Desktop.
traficlight
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