| 1 |
$values: (); |
| 2 |
|
| 3 |
foo { |
| 4 |
$duplicates: 0; |
| 5 |
$num: random(); |
| 6 |
$is-number: type-of($num) == number; |
| 7 |
$is-within-range: $num >= 0 and $num < 1; |
| 8 |
$values: append($values, $num); |
| 9 |
|
| 10 |
@for $i from 1 through 1000 { |
| 11 |
$num: random(); |
| 12 |
$is-number: $is-number and type-of($num) == number; |
| 13 |
$is-within-range: $is-within-range and $num >= 0 and $num < 1; |
| 14 |
@if (index($values, $num) != null) { $duplicates: $duplicates + 1; } |
| 15 |
$values: append($values, $num); |
| 16 |
} |
| 17 |
|
| 18 |
is-defined: $num != "random()"; |
| 19 |
is-number: $is-number; |
| 20 |
is-within-range: $is-within-range; |
| 21 |
is-random: $duplicates < 25; |
| 22 |
} |