Created
January 7, 2012 15:44
-
-
Save tstone/1575079 to your computer and use it in GitHub Desktop.
FizzBuzz in Dart
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
// -- FizzBuzz in Dart -- | |
void fbPrint(c) { | |
if (c % 15 == 0) { print ('FizzBuzz'); } | |
else if (c % 5 == 0) { print ('Buzz'); } | |
else if (c % 3 == 0) { print('Fizz'); } | |
else { print(c); } | |
} | |
void fbFlow(c) { | |
fbPrint(c); | |
if (c < 100) { | |
fbFlow(++c); | |
} | |
} | |
main() => fbFlow(1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment