Skip to content

Instantly share code, notes, and snippets.

@branleur
Created June 14, 2024 00:41
Show Gist options
  • Save branleur/1b2e0df823f663bae67b90cf30bc42cf to your computer and use it in GitHub Desktop.
Save branleur/1b2e0df823f663bae67b90cf30bc42cf to your computer and use it in GitHub Desktop.
Dink keyboard key script identifier
# Run this in your STORY subdir to generate some key-*.c scripts for testing with
from os.path import exists
for i in range(24,256):
fname = "key-" + str(i) + ".c"
if not exists(fname):
with open(fname, "w") as f:
f.write("void main()\n{\nint &key = " + str(i) + "\n say(\"Key is &key\", 1)\nkill_this_task()\n}")
print("Wrote " + fname)
else:
print("Skipping " + fname)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment