Skip to content

Instantly share code, notes, and snippets.

View deluxe's full-sized avatar
💭
Pseudo Random (number) Generator

Deluxe deluxe

💭
Pseudo Random (number) Generator
View GitHub Profile
; --- http://thecodersbreakfast.net/index.php?post/2013/02/18/Coding-challenge-maman-les-petits-avions ---
; --- Function returning the sum of the characters in the string s ---
(defn chars-to-int [s]
"Returns the sum of the characters in the string s."
(apply + (map #(int %) s)))
; --- Function returning a syracuse suite:
; if n1 even, n2 = (n1 / 2),
; if n1 odd, n2 = (n1 * 3 + 1).
; ---