Last active
June 4, 2017 05:14
-
-
Save butackle/1d86ec561e6f92bc46030c154fbcec58 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
フルエ田山田エルフ | |
田田田 | |
エ エ エ | |
ル ル ル | |
フ フ フ | |
*/ | |
((string = '山田エルフ') => string.split('').reduce((arr, char, i) => !i ? [[(str) => str.reverse(), (str) => str.slice(1)].reduce((arr, func) => [...arr, ...func(string.split(''))], [])] : [...arr, arr[0].map((char2) => char2 === char || char2 === string.slice(0, 1) ? char : " ")], []).forEach((str) => console.log(str.join("")))).call() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment