03-11-2019 05:16 PM
Well, there is also data queue ptbypt. These solutions all suffer from the fact that with each insertion all queued elements need to be moved in memory (or the compiler needs to track the rotation in some other way or use some extra scratch memory). Much more effort compared to just blindly overwriting the oldest element as I did, operating fully in-place. 😄
03-11-2019 05:34 PM
@RTSLVU wrote:
How about something like this?
I strongly believe that shift registers resized to more than one left node should not be taught. I never use them.
In any case, these indicators probably belong after the loop, not inside. 😉
While we are doing silly code, here's another (probably) bad idea. 😄
03-11-2019 06:21 PM
@altenbach wrote:
@RTSLVU wrote:
How about something like this?
I strongly believe that shift registers resized to more than one left node should not be taught. I never use them.
In any case, these indicators probably belong after the loop, not inside. 😉
While we are doing silly code, here's another (probably) bad idea. 😄
I like your first idea better with the array replacement, I assume this is the same as the array subset idea expressed earlier. Surprised at the nitpicking you are getting. If you really want to nitpick, for a random number between 0-99, the max iterations you can do is about 43 million before you overflow the i32 sum (2^31/50). Future proof and change to an i64.
mcduff
03-11-2019 06:33 PM - edited 03-11-2019 06:37 PM
Yes, I'd definitely go with my first suggestion and I even mentioned the potential need for I64. We would gain yet another bit going to U64. 😄
(I would probably add a final rotation to ensure the five elements are in sequential order)
03-04-2023 08:03 PM
can you send this?
03-06-2023 06:16 AM - edited 03-06-2023 06:18 AM
Wrongly Posted