Skip to main content
added 20 characters in body
Source Link
MrZander
  • 942
  • 9
  • 17

Clojure - 160 154 Characters

(#(if(= % "BYE")%(do(if(=(.toUpperCase %)%)(prn(str"No, not since "(+ 1930(rand-int 9))"!"))(prn"Huh?! Speak up, sonny!"))(recur(read-line))))(read-line))

Working on golfing it a bit more. Suggestions welcome.

Run through REPL

Clojure - 160 154 Characters

(#(if(= % "BYE")%(do(if(=(.toUpperCase %)%)(prn(str"No, not since "(+ 1930(rand-int 9))"!"))(prn"Huh?! Speak up, sonny!"))(recur(read-line))))(read-line))

Working on golfing it a bit more. Suggestions welcome.

Clojure - 160 154 Characters

(#(if(= % "BYE")%(do(if(=(.toUpperCase %)%)(prn(str"No, not since "(+ 1930(rand-int 9))"!"))(prn"Huh?! Speak up, sonny!"))(recur(read-line))))(read-line))

Working on golfing it a bit more. Suggestions welcome.

Run through REPL

added 15 characters in body
Source Link
MrZander
  • 942
  • 9
  • 17

Clojure - 160160 154 Characters

(loop[x(read-line)]#(if(= x% "BYE")x%(do(if(=(.toUpperCase x%)x%)(prn(str"No, not since "(+ 1930(rand-int 9))"!"))(prn"Huh?! Speak up, sonny!"))(recur(read-line))))(read-line))

Working on golfing it a bit more. Suggestions welcome.

Clojure - 160 Characters

(loop[x(read-line)](if(= x "BYE")x(do(if(=(.toUpperCase x)x)(prn(str"No, not since "(+ 1930(rand-int 9))"!"))(prn"Huh?! Speak up, sonny!"))(recur(read-line)))))

Working on golfing it a bit more. Suggestions welcome.

Clojure - 160 154 Characters

(#(if(= % "BYE")%(do(if(=(.toUpperCase %)%)(prn(str"No, not since "(+ 1930(rand-int 9))"!"))(prn"Huh?! Speak up, sonny!"))(recur(read-line))))(read-line))

Working on golfing it a bit more. Suggestions welcome.

Source Link
MrZander
  • 942
  • 9
  • 17

Clojure - 160 Characters

(loop[x(read-line)](if(= x "BYE")x(do(if(=(.toUpperCase x)x)(prn(str"No, not since "(+ 1930(rand-int 9))"!"))(prn"Huh?! Speak up, sonny!"))(recur(read-line)))))

Working on golfing it a bit more. Suggestions welcome.