Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
State solution solution in Clear category for Multicolored Lamp by pseudorandomcoder
class Lamp:
colors = ["Green", "Red", "Blue", "Yellow"]
def __init__(self):
self.state = -1
def light(self):
self.state += 1
if self.state >= len(self.colors):
self.state = 0
return self.colors[self.state]
July 11, 2018