Skip to content

Instantly share code, notes, and snippets.

@NobukazuHanada
Created December 30, 2013 06:26
Show Gist options
  • Save NobukazuHanada/8178504 to your computer and use it in GitHub Desktop.
Save NobukazuHanada/8178504 to your computer and use it in GitHub Desktop.
class CFizzBuzz{
public static function main(){
fizzbuzz();
}
macro public static function fizzbuzz(){
var fizzbuzzText : String = "\n";
for( i in 1...100 ){
fizzbuzzText += if( i % 15 == 0 ){
"FizzBuzz ";
}else if( i % 3 == 0 ){
"Fizz ";
}else if( i % 5 == 0 ){
"Buzz ";
}else{
Std.string(i) + " ";
}
}
trace(fizzbuzzText);
return macro "end!";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment