Skip to content

Instantly share code, notes, and snippets.

@Leko
Created June 25, 2013 05:34
Show Gist options
  • Save Leko/5856161 to your computer and use it in GitHub Desktop.
Save Leko/5856161 to your computer and use it in GitHub Desktop.
剰余算を使わないSassでのFizzBuzz
@mixin fizzbuzz_not_remainder($n: 100) {
$fb: '', '', Fizz, '', Buzz, Fizz, '', '', Fizz, Buzz, '', Fizz, '', '', FizzBuzz;
$cont: '';
@for $i from 1 through $n {
$tmp: $i;
@while $tmp > 15 {
$tmp: $tmp - 15;
}
@if nth($fb, $tmp) == '' {
$cont: $cont + $i + ' ';
} @else {
$cont: $cont + nth($fb, $tmp) + ' ';
}
$i: $i + 1;
}
&:after { content: $cont; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment