|My Public GitHub Page Is Here||My Website Is Here|
Fizz Buzz Variations in Rust
If you haven't tried solving the FizzBuzz Game before, you might want to try solving it in your favorite language and perhaps also explore Rust a bit before looking at these SPOILERS.
In reverse chronological order these are:
|fizz_buzz-if-let.rs||cyclic iterators with if let|
|fizz_buzz-match.rs||cyclic iterators with match|
|fizz_buzz-devel.rs||early exploration and false starts|
My first idea was to use closures. I didn't know enough to make that work until I'd found the other solutions. I was delighted when I found the trick of creating cyclic iterators using standard components.
I would love to find a flexible approach that didn't require so much mutability without incurring the usual overhead of using the mod operator or growing the heap. Tail Call Optimization would help but Rust doesn't offer that yet.
J. Greg Davidson, Thursday, 30 April 2015