Created
December 12, 2019 23:32
-
-
Save alairock/01d569b4be4f4d8d6c03f0c3e597fcce to your computer and use it in GitHub Desktop.
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
SMALL = 1 | |
MED = 2 | |
LARGE = 3 | |
s = list(range(1, 31)) | |
m = list(range(31, 61)) | |
l = list(range(61, 91)) | |
print(s) | |
print(m) | |
print(l) | |
def get_stall(size): | |
if size == 1 and len(s) > 0: | |
return SMALL, s.pop(0) | |
elif size <= 2 and len(m) > 0: | |
return MED, m.pop(0) | |
elif size <= 3 and len(l) > 0: | |
return LARGE, l.pop(0) | |
raise Exception("WTF kind of car is this? Yo.") | |
def return_stall(size, number): | |
if size == 1: | |
s.append(number) | |
elif size == 2: | |
m.append(number) | |
elif size == 3: | |
l.append(number) | |
v1_size, v1_stall = get_stall(SMALL) | |
v2 = get_stall(MED) | |
v3 = get_stall(SMALL) | |
v4 = get_stall(LARGE) | |
print(s) | |
print(m) | |
print(l) | |
return_stall(v1_size, v1_stall) | |
print(s) | |
print(m) | |
print(l) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment