Skip to content

Instantly share code, notes, and snippets.

@klang
Created Aug 1, 2010
Embed
What would you like to do?
The song 'Around the World' by Daft Punk has a deeply repetitive nature, unfortunately the lyrics is oftent stated wrong. The song has 4 verses consisting of 8, 16, 28 and 20 double repetitions of the phrase 'Around the world'. All in all, the song has 72
(ns daft
(meta {:description "The song 'Around the World' by Daft Punk has a deeply repetitive nature, unfortunately the lyrics is oftent stated wrong.
The song has 4 verses consisting of 8, 16, 28 and 20 double repetitions of the phrase 'Around the world'.
All in all, the song has 72 double repetitions or 144 repetitions of the iconic phrase."}))
(def lyrics (repeat "Around the world, around the world"))
(defn sing [lyrics]
(reduce str
(interleave
(map #(reduce str %)
(map #(interleave % (repeat "\n"))
(map #(take % lyrics) [8 16 28 20])))
(repeat "\n") )))
(comment
;; works in the REPL
(println (sing lyrics)))
daft> (println (sing lyrics))
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
Around the world, around the world
nil
daft>
@klang
Copy link
Author

klang commented Aug 1, 2010

;; another notation, suggested by yogthos on reddit

(defn sing [lyrics]
  (reduce str
    (->> 
      [8 16 28 20]
      (map #(take % lyrics))
      (map #(interleave % (repeat "\n")))
      (map #(reduce str %))
      (interleave (repeat "\n"))) ))

@shoorik
Copy link

shoorik commented Aug 2, 2010

There's a bug in the usage instructions, should be: (sing lyrics) not (sing song).

@klang
Copy link
Author

klang commented Aug 16, 2010

Legacy, I guess. Thanks. Corrected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment