Post Reply 
RPL mini-challenge: Create an anti-Identity Matrix
05-15-2018, 04:52 PM
Post: #41
RE: RPL mini-challenge: Create an anti-Identity Matrix
(05-15-2018 12:22 PM)DavidM Wrote:  ListExt already has a similar list-focused command (LMRPT). It doesn't need the "group size" argument, as that is inherently defined by the list argument itself.

Example:
{ 1 2 3 } 4 LMRPT => { 1 2 3 1 2 3 1 2 3 1 2 3 }

It also accepts a non-list object as the first argument, and in that case simply acts like NDUPN →LIST:

1 4 LMRPT => { 1 1 1 1 }

LMRPT is a relatively good performer. « 30 1 OVER LMRPT SWAP LMRPT » creates a 900-element list in about 0.08s on a 50g.

NMDUP could be useful as a post in the General Software Library, so I'll put something together for that.

NMDUP is quite fast as well. with 10 items on stack, << 10. 200. NMDUP >> takes about 65 milliseconds.

I would also like to see it in the ListExt library despite its similarity to LMRPT.

John
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: RPL mini-challenge: Create an anti-Identity Matrix - John Keith - 05-15-2018 04:52 PM



User(s) browsing this thread: 1 Guest(s)