Author: | flice |
---|---|
Mode: | factor |
Date: | Thu, 27 Nov 2008 19:15:36 |
:: three ( lambda -- ) "three" . B lambda [ random-int swap keep ] dup bi "three-ifs" . 2dup [ 0 <= ] bi@ or [ 2dup [ 0 <= ] bi@ and [ 2drop lambda three ] [ random-real lambda keep 2nip 0 <= [ lambda three ] when ] if ] [ 2drop ] if ;