Post Reply 
Programming puzzles: processing lists!
11-05-2017, 10:04 PM (This post was last modified: 11-10-2017 10:57 PM by StephenG1CMZ.)
Post: #226
RE: Programming puzzles: processing lists!
I have implemented #32 multiple GET on the Prime.

Code:


 EXPORT GETLST(LST,GETLST)
 //Solves Puzzle #32. POSNā‰„0.
 BEGIN
 LOCAL II;

  IF SIZE(GETLST) THEN
   RETURN MAKELIST(LST(GETLST(II)),II,1,SIZE(GETLST));
  END;
  RETURN {};//ASKED TO GET NOTHING
 END;
Update: As typed here, the procedure name and parameter name are the same.
I'd suggest they shouldn't be, to minimise the risk of SIZE() measuring the wrong one.

(A version with error checking is in my List API: ListGETLIST
http://www.hpmuseum.org/forum/thread-9411.html)

Stephen Lewkowicz (G1CMZ)
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Programming puzzles: processing lists! - StephenG1CMZ - 11-05-2017 10:04 PM



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