Skip to content

Instantly share code, notes, and snippets.

@5t111111
Last active February 15, 2016 12:57
Show Gist options
  • Save 5t111111/57b2fff64094949bfcda to your computer and use it in GitHub Desktop.
Save 5t111111/57b2fff64094949bfcda to your computer and use it in GitHub Desktop.
ケブンリッジ関数 (単語だけに対応です…)
kebun=->(s){$><<s[0]+(s[1..-2].chars.shuffle*'')+(!s[1]?'':s[-1])}
# kebun.call('ケンブリッジ') => ケンブッリジ, ケリッブンジ, ケリンブッジ, ケリブンッジ, ケンッリブジ ...
# kebun.call('ケン') => ケン
# kebun.call('ケ') => ケ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment