RPN Mini-Challemge: Splice & Split register blocks
|
12-20-2019, 02:52 PM
(This post was last modified: 12-20-2019 03:04 PM by Ángel Martin.)
Post: #1
|
|||
|
|||
RPN Mini-Challemge: Splice & Split register blocks
No doubt there must be more interesting ways to spend a couple of hours, but if you'd fancy this subject here's the mini-challenge description:
#1:- Splice: Given two equal-sized blocks of data registers, {R01-Rn} and {Rn+1, R2n} your mission is to write a data splicing routine that has one register from each block stored consecutively, i.e. {R1, Rn+1, R2, Rn+2,... Rn, R2n}. #2:- Split.- Separate the interlaced 2n-block of registers into two n-Regs blocks, so the routine does the inverse task. In both cases the resulting block occupies the same memory area, i.e. from R01 to R2n.
a) Expert Level: it's ok to use an auxiliary data registers area for scratch. b) Master Level: do it in-place using swapping actions. Rumor has it that the master level fits in the page' margins of this post... ;-) BTW solutions in RPL and BASIC are kinda trivial, but I predict this is going to make us all hate RPN for a while... Disclaimer: I haven't done it yet, so we're all in equal condition here (kinda how I like it). Cheers, ÁM "To live or die by your own sword one must first learn to wield it aptly." |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
RPN Mini-Challemge: Splice & Split register blocks - Ángel Martin - 12-20-2019 02:52 PM
RE: RPN Mini-Challemge: Splice & Split register blocks - Werner - 12-20-2019, 04:41 PM
RE: RPN Mini-Challemge: Splice & Split register blocks - Ángel Martin - 12-22-2019, 05:55 AM
RE: RPN Mini-Challemge: Splice & Split register blocks - J-F Garnier - 12-21-2019, 09:14 AM
RE: RPN Mini-Challemge: Splice & Split register blocks - Werner - 12-21-2019, 10:02 AM
RE: RPN Mini-Challemge: Splice & Split register blocks - Paul Dale - 12-21-2019, 11:42 PM
RE: RPN Mini-Challemge: Splice & Split register blocks - Werner - 12-29-2019, 06:04 PM
RE: RPN Mini-Challemge: Splice & Split register blocks - ijabbott - 12-29-2019, 06:20 PM
|
User(s) browsing this thread: 1 Guest(s)