Post Reply 
Massaging output of 50g's FACTORS command
01-04-2015, 09:58 AM (This post was last modified: 01-04-2015 10:23 AM by Gilles.)
Post: #8
RE: Massaging output of 50g's FACTORS command
I wondered if it was possible to split a list with only one DOSUBS and found this way :

Code:
1. « NSUB 1. == {{}{} ROT} IFT + SWAP » DOSUBS

{"a" "b" "c" "d" "e" "f" "g" "h" }
->
{ { "b" "d" "f" "h" } { "a" "c" "e" "g" } }

And to get the result in right order both with odd or even number of elements in the list

Code:

1. « NSUB 1. == {{}{} ROT} IFT + SWAP
     IF 'NSUB==ENDSUB AND NOT(NSUB MOD 2)' THEN SWAP END  » DOSUBS
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Massaging output of 50g's FACTORS command - Gilles - 01-04-2015 09:58 AM



User(s) browsing this thread: