Created
November 19, 2019 14:38
-
-
Save apaap/f1bc01df558a03f50dd73eb5ac610c1e to your computer and use it in GitHub Desktop.
Update unsynthesized xs19 soup counts
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
curl -o xs19.txt https://catagolue.appspot.com/textcensus/b3s23/C1/xs19 | |
curl -o xs19-synth.txt https://catagolue.appspot.com/textcensus/b3s23/synthesis-costs/xs19 |
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
import operator | |
unsynthed = [] | |
with open("xs19-synth.txt") as Fin: | |
for line in Fin.readlines(): | |
if not line[1:5] == "xs19": | |
continue | |
parts = line.split(',') | |
code = parts[0].strip('"') | |
cost = parts[1].strip().strip('"') | |
if cost == '999999999999999999': | |
unsynthed.append(code) | |
occurrences = [] | |
with open("xs19.txt") as Fin: | |
for line in Fin.readlines(): | |
if not line[1:5] == "xs19": | |
continue | |
parts = line.split(',') | |
code = parts[0].strip('"') | |
if code in unsynthed: | |
cost = int(parts[1].strip().strip('"')) | |
occurrences.append((code, cost)) | |
occurrences.sort(key=operator.itemgetter(1), reverse=True) | |
for object in occurrences: | |
print("{} - {}".format(object[0], object[1])) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment