Post Reply 
Programming puzzles: processing lists!
05-28-2017, 07:10 PM
Post: #101
RE: Programming puzzles: processing lists!
(05-28-2017 06:31 PM)John Keith Wrote:  DOH!

I realized what the problem was: I had a program in my HOME directory called LREPL, a similar program I had been working on a few weeks ago. I renamed that program and everything is working fine now. ;-)

Sorry for wasting your time, I really appreciate your effort.

Homer Simpson (aka John)

Mystery solved! Thanks for keeping me from beating my head against the wall trying a bunch more tests in an effort to track it down. No time was wasted. Smile

Here's some brief descriptions of a few more commands I've created:

S→NL (String to Numeric List)

Converts string to a list of numbers. The numbers are the same as if you executed "NUM" on each character of the string in sequence.

Ex.: "ABCDEFG" => { 65. 66. 67. 68. 69. 70. 71. }

NL→S (Numeric List to String)

Reciprocal command to the above.

LCLLT (List Collate)

Given a list of lists, returns a single list with the contents of each sublist extracted one item at a time in sequence. A picture is easier to understand than the description:
{ { 1 1 1 } { 2 2 2 } { 3 3 3 } } => { 1 2 3 1 2 3 1 2 3 }

LDST (List Distribute)

Reciprocal of the above; needs a "groups" argument. For the above example, the group count is 3, so:
{ 1 2 3 1 2 3 1 2 3 } 3 => { { 1 1 1 } { 2 2 2 } { 3 3 3 } }

(you can also think of LDST as "List Deal", because it is analogous to dealing a deck of cards into "groups" hands)

LSPLT (List Split)

Splits a list into two lists where the length of the first sublist is given as a numeric argument. The result is a list of the two lists. The number given must be less than or equal to the length of the list, and also non-negative. If equal, the list and an empty list are returned. If 0, an empty list and the list are returned.

LSDIV (List Subdivide)

Given a list and a number, divides the list into the number of sublists indicated. Number must evenly divide the list contents.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: Programming puzzles: processing lists! - DavidM - 05-28-2017 07:10 PM

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