From 2c9ec65acf5f5c332d1b48e27630956adf617665 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 18 Dec 2008 00:15:07 -0600 Subject: [PATCH] Move sequences.lib:randomize to random --- basis/random/random.factor | 3 +++ 1 file changed, 3 insertions(+) diff --git a/basis/random/random.factor b/basis/random/random.factor index 5c93606ab5..be2d5955cd 100755 --- a/basis/random/random.factor +++ b/basis/random/random.factor @@ -51,6 +51,9 @@ PRIVATE> [ length random-integer ] keep nth ] if-empty ; +: randomize ( seq -- seq' ) + dup length 1 (a,b] [ dup random pick exchange ] each ; + : delete-random ( seq -- elt ) [ length random-integer ] keep [ nth ] 2keep delete-nth ;