Paste: nspread

Author: slava
Mode: factor
Date: Sun, 8 Feb 2009 04:11:37
Plain Text |
MACRO: nspread ( quots n -- quot )
    over empty? [ 2drop [ ] ] [
        [ [ but-last ] dip ] [ [ peek ] dip ] 2bi swap
        '[ [ _ _ nspread ] _ ndip @ ]
    ] if ;

9 [ ] each { [ 3array ] [ rot 3array ] [ -rot 3array ] } 3 nspread 3array .
=> { { 0 1 2 } { 4 5 3 } { 8 6 7 } }

New Annotation

Summary:
Author:
Mode:
Body: