dotfiles/scripts/letrtes
Geoffrey Frogeye ee178b7d57
nix: Make nix the root
Which means now I'll have to think about real prefixes in commit names.
2023-11-26 23:58:22 +01:00

24 lines
505 B
Plaintext
Executable file

#!/usr/bin/env nix-shell
#! nix-shell -i python3 --pure
#! nix-shell -p python3
import random
import sys
for line in sys.stdin:
nl = ""
word = ""
for c in line:
if c.isalpha():
word += c
else:
if len(word) > 3:
wrd = list(word)[1:-1]
random.shuffle(wrd)
nl += word[0] + "".join(wrd) + word[-1]
else:
nl += word
word = ""
nl += c
print(nl, end="")