Programming puzzles: processing lists!
|
06-11-2017, 05:51 PM
Post: #134
|
|||
|
|||
RE: Programming puzzles: processing lists!
(06-07-2017 08:57 AM)pier4r Wrote: ...83 seconds of LSHF LSHF should be faster in the attached release. Not as fast as your binary shuf, of course, but on an ARM-based RPL calculator (49g+ or 50g) this version is about twice fast as the previous version in my testing. And that includes the new-and-improved range checking for the RAND seed as well. You'll need to uninstall the previous library before installing this one. There's a handy command for doing that -- it's the last one in the library (so you can simply activate the library menu in the normal way, then go PREV to see it). As a reminder, the command numbers have changed in this version, so be aware that any stored programs using the previous release's commands will now need to be edited appropriately. A text file containing detailed descriptions of each command is included in the zip. Here's a summary of the current commands included: LCLLT - collates a list of sublists LCNT - counts objects in a list LDDUP - removes duplicates from a list LDST - distributes list items into sublists (reciprocal of LCLLT) LEQ - checks list items to see if any do not match LGRP - replaces repeated elements with a single instance LMRPT - repeats list contents as indicated by count LNDUP - creates a list by repeating an object as indicated by count LREPL - replaces list elements with a substitute object as indicated LROT - rotates list elements left or right as indicated by count LRPCT - list with LGRP elements and another list of the count of each element LSDIV - subdivides a list into <count> sublists LSHF - shuffles the contents of a list LSPLT - splits a list as indicated into two sublists LSUM - ΣLIST that also handles lists with 0 or 1 element LSWP - swaps the position of two list elements LXIL - explodes inner sublists into individual elements (non-recursive) LXILR - recursive version of LXIL S→NL - converts a string to a list of numbers NL→S - converts a list of numbers to a string S→SL - converts a string to a list of characters SL→S - converts a list of characters to a string |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)