Skip to content

Instantly share code, notes, and snippets.

@tstone
Created January 7, 2012 15:44
Show Gist options
  • Save tstone/1575079 to your computer and use it in GitHub Desktop.
Save tstone/1575079 to your computer and use it in GitHub Desktop.
FizzBuzz in Dart
// -- 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