Skip to content
Sign UpLog In
Profile icon

Rahul Acharya

Hacker
@Acharyarahul
Repls
Community
Acharyarahul
Acharyarahul
shared a Post
2 years ago
How exactly does this fizzbuzz code work?
(clojure.pprint/pprint (map vector (range 25) (cycle [:fizz :_ :_]) (cycle [:buzz :_ :_ :_ :_]))) `
AdmirableBigheartedCodes
Clojure
Wumi4
Wumi4
Hmmm... I don't know anything about Clojure so I will try to explain as best as I can: The clojure.pprint/pprint macro will pretty print the result of the FizzBuzz The map macro will map the result at type vector (Which I believe is like dynamic array) The range 25 will work like a for loop from 0 (maybe) to 25 (also maybe) I don't know about what 2 final lines of code works, but I can confirm that it is the part checking if the number in the for loop is a Fizz or a Buzz or both.2 years ago