Created
June 25, 2013 05:34
-
-
Save Leko/5856161 to your computer and use it in GitHub Desktop.
剰余算を使わないSassでのFizzBuzz
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
@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