Browse Source

Poamcfnrree irvmmpneotes to ltrsete and adedd letetrs

master
Geoffrey Frogeye 9 months ago
parent
commit
fd4722f989
  1. 23
      config/scripts/lestrte
  2. 21
      config/scripts/letrtes

23
config/scripts/lestrte

@ -3,26 +3,19 @@
import sys
import random
# maj = True
for line in sys.stdin:
nl = ""
word = ""
grace = True
for c in line:
if c.isalpha():
if grace:
nl += word
nl += c
word = ""
grace = False
else:
word += c
word += c
else:
wrd = list(word)
random.shuffle(wrd)
nl += "".join(wrd)
nl += c
if len(word) > 2:
wrd = list(word)[1:]
random.shuffle(wrd)
nl += word[0] + "".join(wrd)
else:
nl += word
word = ""
grace = True
nl += c
print(nl, end="")

21
config/scripts/letrtes

@ -0,0 +1,21 @@
#!/usr/bin/env python3
import sys
import random
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="")
Loading…
Cancel
Save