Common words should still be avoided to be used as passwords. This challenge is about coding a very simple program that munges a given password (Modify Until Not Guessed Easily).
Input
A word, which is a string written in the alphabet abcdefghijklmnopqrstuvwxyz
. It does not matter if the letters are lowercase or uppercase.
Munging
- Change any repeated sequence of a same letter to itself preceded by the number of times the letter was repeated (
LLLL
with4L
) - Change the first
a
with@
- Change the first
b
with8
- Change the first
c
with(
- Change the first
d
with6
- Change the first
e
with3
- Change the first
f
with#
- Change the first
g
with9
- Change the first
h
with#
- Change the first
i
with1
- Change the second
i
with!
- Change the first
k
with<
- Change the first
l
with1
- Change the second
l
withi
- Change the first
o
with0
- Change the first
q
with9
- Change the first
s
with5
- Change the second
s
with$
- Change the first
t
with+
- Change the first
v
with>
- Change the second
v
with<
- Change the first
w
withuu
- Change the second
w
with2u
- Change the first
x
with%
- Change the first
y
with?
Rule 1 must be applied the needed number of times until it is not possible to apply it more. After that the rest of the rules are applied.
Output The munged word
Examples
codegolf
-->(0639o1#
programming
-->pr09r@2m1ng
puzzles
-->pu2z135
passwords
-->p@25uu0r6$
wwww
-->4uu
aaaaaaaaaaa
-->11a
lllolllolll
-->3103io3l
jjjmjjjj
-->3jm4j
This is code-golf, so please make your program as short as possible!
Nothing in this post should be used as password ideas or as any part of password practices.