Created
December 23, 2013 04:31
-
-
Save Snugug/8091652 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains 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
// ---- | |
// Sass (v3.3.0.rc.1) | |
// Compass (v0.13.alpha.10) | |
// ---- | |
@function quicksort($list) { | |
$QS-Less: (); | |
$QS-Equal: (); | |
$QS-Large: (); | |
$QS-Length: length($list); | |
$QS-Seed: if(function-exists(random), random($QS-Length), $QS-Length / 2); | |
@if $QS-Seed == 0 { | |
$QS-Seed: 1; | |
} | |
@if $QS-Length > 1 { | |
$QS-Seed: nth($list, $QS-Seed); | |
@each $Item in $list { | |
@if $Item < $QS-Seed { | |
$QS-Less: append($QS-Less, $Item); | |
} | |
@else if $Item == $QS-Seed { | |
$QS-Equal: append($QS-Equal, $Item); | |
} | |
@else { | |
$QS-Large: append($QS-Large, $Item); | |
} | |
} | |
$QS-Less: quicksort($QS-Less); | |
$QS-Large: quicksort($QS-Large); | |
$QS-Return: join($QS-Less, $QS-Equal); | |
$QS-Return: join($QS-Return, $QS-Large); | |
@return $QS-Return; | |
} | |
@return $list; | |
} | |
$list: -1px 400px 900px 800px 300px; | |
.quicksort-love { | |
content: quicksort($list); | |
} |
This file contains 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
.quicksort-love { | |
content: -1px 300px 400px 800px 900px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment