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