Created
          November 14, 2014 06:53 
        
      - 
      
- 
        Save mattdeboard/35b4e807dad8042f6dae to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | fn fizzbuzzinator (x: int) -> &'static str { | |
| if x % 3i == 0i && x % 5i == 0i { "FizzBuzz" } | |
| else if x % 3i == 0i { "Fizz" } | |
| else if x % 5i == 0i { "Buzz" } | |
| else { "" } | |
| } | |
| fn main() { | |
| for i in range(0i, 100i) { | |
| let val: &str = fizzbuzzinator(i); | |
| if val == "" { continue; }; | |
| println!("{} {}", i, val) | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment