Skip to content

Instantly share code, notes, and snippets.

@apaap
Created November 19, 2019 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apaap/f1bc01df558a03f50dd73eb5ac610c1e to your computer and use it in GitHub Desktop.
Save apaap/f1bc01df558a03f50dd73eb5ac610c1e to your computer and use it in GitHub Desktop.
Update unsynthesized xs19 soup counts
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
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