Programming puzzles: processing lists!
|
10-17-2017, 07:20 PM
Post: #207
|
|||
|
|||
RE: Programming puzzles: processing lists!
(10-17-2017 05:00 PM)pier4r Wrote: Added the #39 , it is super easy to solve but I'd like to know if there are quick/elegant ways to solve it. Not sure how elegant this is, but given the arguments in the order specified in your first post (list, position, offset): Code: \<< ...would seem to work. (10-17-2017 05:00 PM)pier4r Wrote: I thought that one could do That will work, of course, but you'd end up doing a lot of unnecessary additions for a large list. I haven't tested it, but I can't imagine that those additions would be faster than a simple GET/ADD/PUT combination. If you still want to play around with that, though, the following can be used to generate a list of 0s with a single constant in a specified position. Stack setup 3: constant 2: position 1: list size Code: \<< |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)