Created
June 5, 2019 22:29
-
-
Save greysondn/fa87556bbf801c35bd5f4e185a5fb76b to your computer and use it in GitHub Desktop.
Solution for a puzzle in Exit/Corners
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
def main(): | |
# need all the values to work with | |
red = (0.0, 1.05, 8.1, 20.0, 37.9, 44.0) | |
green = (0.0, 15.9, 17.3, 17.8, 18.8, 19.1) | |
blue = (0.0, 8.8, 9.9, 10.0, 12.4, 14.1) | |
grey = (0.0, 6.4, 6.6, 6.8, 7.3, 7.5) | |
# we want a case such that red + green = blue + grey, so we have to start | |
# by looping over every single one | |
for r in red: | |
for g in green: | |
for b in blue: | |
for q in grey: | |
# check here | |
if ((r + g) == (b + q)): | |
# match! | |
print("Match!") | |
print("red: " + str(r)) | |
print("green: " + str(g)) | |
print("blue: " + str(b)) | |
print("grey: " + str(q)) | |
#if __name__ == "__MAIN__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment