0 Replies - 1146 Views - Last Post: 07 April 2010 - 12:45 AM

#1 Raynes   User is offline

  • D.I.C Lover
  • member icon

Reputation: 614
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

[Lisp] [Clojure] Plaintext -> L33tsp43k converter

Posted 07 April 2010 - 12:45 AM

Description: Isn't it obvious? It's extensible, in that you can add your own characters to convert and what they need to be converted to.
(defn char-to-leet [c]
  (condp = c
    e 3
    a 4
    b 8
    g 9
    i !
    l 1
    o 0
    q 9
    s 5
    t 7
    z 2
    c))

(defn leetspeek [s]
  (->> s (#(.toLowerCase %)) (map char-to-leet) (apply str)))

Is This A Good Question/Topic? 0
  • +

Page 1 of 1