Skip to content

Instantly share code, notes, and snippets.

@adewale
Created June 13, 2009 15:31
Show Gist options
  • Save adewale/129286 to your computer and use it in GitHub Desktop.
Save adewale/129286 to your computer and use it in GitHub Desktop.
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