A simple algorithm, in Corvid

Already found a solution?
If not yet, so you can find here a little example…

https://russian-dima.wixsite.com/meinewebsite/download-list