« first day (41 days earlier)      last day (267 days later) » 

Leo
8:43 AM
I thought this could make a nice challenge :)
 
9:32 AM
@Leo heh, nice, I thought about turning that into a challenge as well :)
 
 
4 hours later…
1:16 PM
a simple modification of your ordinal formatter to handle odd length inputs: tio.run/nexus/…
actually, I just realised the challenge is simpler because we don't need the surrounding mirrors, so this should work: tio.run/nexus/alice#@6@fr1cX6W@taB1pXxekz@XgGaVnXxeVW6doXxUZ8/@/…
 
 
2 hours later…
Leo
3:15 PM
Yeah, that was about what I had in mind, but you have a useless swap in there tio.run/nexus/alice#@6@fr1cX6Z@rqBhZVRcTw@XgGaVnbx1lXWdvHxT5/…
 
hm, I thought I needed that for something. maybe I was trying something else, can't remember.
 
4:05 PM
the control flow can probably be improved
 
Leo
Wow, that looks complex
 
the second line is a subroutine that computes a Fibonacci number
the first line calls it once, then gets the divisors and then calls it once again for each divisor (treating the stack like a queue by processing the individual divisors from the bottom up, so that we can defer computing the sum to the end)
the return stack shenanigans are quite fun though, because the code continues after the subroutine once the loop on the first line is depleted
 
Leo
ok, I got your tricks with return stack, nice :)
 
fun fact: the outer loop over the divisors runs once more than it needs to, but it doesn't matter because F(1) = 1
 
Leo
4:32 PM
nope, I didn't get this
why are you doing B1?
 
the B is the divisors, the 1 is just because I have the ; which discards the other Fibonacci result at the beginning of the loop
the 1 could literally be anything that pushes a single value
(and the reason I have the ; at the beginning of the loop is that I can save on a k this way... remember the nested loop trick we talked about a few days ago, which requires nested loops to be at the end of the surrounding loop?)
 
Leo
I remember the trick, but this is definitely more advanced :D I don't have enough time right now, I'll look at it again later to understand it better^^
 
 
4 hours later…
Leo
8:14 PM
@MartinEnder unrelated, but is this a bug?
 
hmmm, interesting
 
8:31 PM
oh yeah, I know why that happens
should be fixed (on github)
 

« first day (41 days earlier)      last day (267 days later) »