Created
June 13, 2009 15:31
-
-
Save adewale/129286 to your computer and use it in GitHub Desktop.
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
list := List clone | |
while (list count() < 6, | |
n := Number random(1, 50) floor | |
if( (list contains( n ) ) == Nil, //true if list doesn't contain n | |
list add( n ) | |
) | |
) | |
Became: | |
l := List clone | |
while (l size < 6, | |
n := Random value(1 50) floor round | |
l appendIfAbsent( n ) | |
) | |
l sort print |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment