Created
April 23, 2020 05:24
-
-
Save orirawlings/bb66b0b5d99ebdf9fdbc305752fa5621 to your computer and use it in GitHub Desktop.
Revisions
-
orirawlings created this gist
Apr 23, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ BEGIN { while((getline < "/usr/share/dict/words") > 0) { first = substr($0, 1, 1) wordcnts[first]++ words[first,wordcnts[first]] = $0 } srand() } { len = length($0) for (i=1; i<=len; i++) { l = substr($0, i, 1) word = words[l,int(rand()*wordcnts[l])+1] printf "%s%s", word, (i < len ? " " : "\n") } }