BogoSort in the Taylor-Swift Programming Language

"The process of preparing programs for a digital computer is especially attractive, not only because it can be economically and scientifically rewarding, but also because it can be an aesthetic experience much like composing poetry or music."

— Donald Knuth, The Art of Computer Programming, Vol. 1

I also believe in the converse: creative formalization of music into algorithms is a unique representation of what computer science embodies.

So, for fun, I invented a poetic variation of the "Swift" programming language: Taylor-Swift. And I used this new language to code the famous BogoSort algorithm (shuffle a list of numbers randomly; check if sorted; if not, repeat the process, until a sorted list appears).

Shown below. (Specific phrases that make up the BogoSort algorithm are highlighted.)

Algorithm B1: BogoSort (Taylor's Version)

Condensed Form

  1. Roll the dice. (Shuffle the list.)
  2. Nothing coming? (Not sorted?)
  3. Repeat, until it works. (Repeat, until it's sorted.)