This post is inspired by a post a friend shared with me on Twitter. It shows a set of famous chocolate bar wrappers that have been cut and reglued together. That immediately got me thinking if I could get a computer to do this for me. There are so many other situations where this could come in handy. For example, have you ever found yourself alone with a letterboard and wondered what fun you could make by rearranging the letters? Wonder no more. There will be some rude words in this article. If you’re not too worried about that, read on. The source code for this article can be found on Github . Some Ins and Outs The program takes a list of everyday words and returns a list of rude words. Each rude word returned will have a pipe character inserted at points where an input word would have to be cut to form the rude word. For example, let’s say the program was given “twix” and “kit kat”. It would return “tw|at”. It would be up to the user to figure out from which input word...
Tackling life’s serious issues with engineering