Home
About
Policies
FAQ
Forums
Registration
Password Recovery

Lsort (MPI)

From Tapestries MUCK

Revision as of 10:01, 30 March 2007 by Ash-Fox (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

lsort

{lsort:list}
{lsort:list,var1,var2,expr}

Returns the sorted contents of list. If 4 arguments are given, then it evaluates expr with a pair of values, in var1 and var2.

If expr returns true, then it will swap the positions of the two values in the list. It runs this comparison on every pair of items in the list, so it will be evaluated N*N times, where N is the number of items in the list.

This method can also be used to randomize a list.

Example:

{lsort:{&list},v1,v2,{gt:{dice:100},50}}
Personal tools
Namespaces
Variants
Actions
navagation
information
wiki
Toolbox