Skip to content
Browse files

cleaned up fizzbuzz (lol)

  • Loading branch information...
1 parent 7783288 commit f41c60e818c5c5b501816fc371bb4daa08496e04 @tedpennings committed
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/fizzbuzz.clj
View
12 src/fizzbuzz.clj
@@ -1,10 +1,10 @@
(defn fizzbuzz []
(loop [x 1]
- (prn x)
- (if (= 0 (rem x 3))
- (prn "Fizz"))
- (if (= 0 (rem x 5))
- (prn "Buzz"))
- (println)
+ (print (str x " "))
+ (if (zero? (mod x 3))
+ (print "Fizz"))
+ (if (zero? (mod x 5))
+ (print "Buzz"))
+ (println) ;only line break printed
(if (< x 100)
(recur (inc x)))))

0 comments on commit f41c60e

Please sign in to comment.
Something went wrong with that request. Please try again.