1
0
mirror of https://github.com/osmarks/random-stuff synced 2026-06-02 10:52:13 +00:00

change things in some way

This commit is contained in:
osmarks
2025-05-18 14:09:06 +01:00
parent d057781e3c
commit f32abdf5b6
12 changed files with 672 additions and 45 deletions
+23
View File
@@ -0,0 +1,23 @@
import json
import random
with open("nouns.json", "r") as f:
nouns = set(json.load(f))
with open("comparisons.jsonl", "a") as f:
def writeline(obj):
f.write(json.dumps(obj, separators=(",", ":")) + "\n")
for noun in nouns:
other_noun = random.choice(list(nouns - {noun}))
print(noun, "/",other_noun)
pref = input("a/b/e/x/y: ")
writeline({"a": noun, "b": other_noun, "pref": pref})
if pref == "x":
writeline({"a": noun, "b": other_noun, "pref": "x"})
nouns.remove(noun)
elif pref == "y":
writeline({"a": other_noun, "b": noun, "pref": "y"})
nouns.remove(other_noun)
f.flush()