Skip to content

Instantly share code, notes, and snippets.

@butackle
Last active June 4, 2017 05:14
Show Gist options
  • Save butackle/1d86ec561e6f92bc46030c154fbcec58 to your computer and use it in GitHub Desktop.
Save butackle/1d86ec561e6f92bc46030c154fbcec58 to your computer and use it in GitHub Desktop.
/*
フルエ田山田エルフ
田田田
エ エ エ
ル ル ル
フ フ フ
*/
((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