Created
January 15, 2022 05:16
-
-
Save DashLt/33dbd336b0416e8b8130a01670f170b1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# I was extremely tired when writing this, please excuse the terrible code. | |
import requests | |
i = 0 | |
results = [] | |
green_indices = set() | |
green = set() | |
yellow = set() | |
white = set() | |
while (i < 0x10): | |
if hex(i)[2:] not in white: | |
hex_string = [hex(i)[2:]]*16 | |
_i = 0 | |
for _i in green_indices: | |
for j in range(0x10): | |
j = hex(j)[2:] | |
if j not in white and j not in yellow and j not in green and j not in hex_string: | |
hex_string[int(_i)] = j | |
break | |
print(hex_string) | |
r = list(requests.get(f"https://dwordle.glitch.me/{''.join(hex_string)}").text[:-1]) | |
r_copy = [] | |
for j in r: | |
if j in "🟩🟨⬜": # I kept getting zero width spaces for some unintelligible reason | |
r_copy.append(j) | |
for _i, j in enumerate(r_copy): | |
char = hex_string[_i] | |
if j == "🟩": | |
green_indices.add(_i) | |
green.add(char) | |
results.append((_i, char)) | |
elif j == "🟨": | |
yellow.add(char) | |
elif j == "⬜": | |
white.add(char) | |
i += 1 | |
print(results) # this prints an unsorted solution |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment