r/dailyprogrammer_ideas • u/rain5 • Jun 11 '17
[Intermediate] Chinese Whispers
Chinese Whispers reads in a sentence and:
- loads a dictionary of words
- picks a word* at random from the input (* word meaning, skip anything not spelled correctly)
- replace it with a different randomly chosen word that starts with the same letter
- print the result
it can be run multiple times to change the sentence ever more.
7
Upvotes
4
u/JakDrako Jun 12 '17
Sounds fun. As a bonus, a soundex algorithm could be used on the dictionary words and then substitution be done using similar (same soundex value) sounding words. The final sentence would sound similar, but might be quite different.
2
u/IPV4clone Jun 12 '17
Just did this on C#. I would maybe include a .txt list for people to use.
I used this one: https://svnweb.freebsd.org/base/head/share/dict/web2
1
u/ChazR Jun 13 '17
This is another good one.
I think it should use soundex - it's not a difficult algorithm.
I like it.