Page 1 of 1

Split by 3, 5, 7, 9

Posted: Fri Nov 21, 2014 4:01 am
by Z903
Hey everyone,

So a while ago I came up with a way to use splitters to split a stream of resources by odd numbers ( or any number for that matter ).

The basic principle is to find the next biggest power of two and route the undesired fraction back into the input. This creates a recursive splitting. In the case of a divide by 3 every 4th item will loop back to the beginning and be resorted.

These are just some simple examples ( 3, 5, 7, 9 ).
3579.jpg
3579.jpg (488.02 KiB) Viewed 41750 times
They have been kept simple for the example using only basic belts.
3split.png
3split.png (240.48 KiB) Viewed 41713 times
I have also made some designs to take 2 and split them evenly across 3 output belts. The input lines are fully loaded with ore and split evenly.

This originally was inspired by my need to upgrade my smelting array from 4 to 6 furnace lines ( from 64 to 96 elec ).

If anybody has a request for me to post an x in to y out, please do.

Let me know if this is of any use to you,
Have fun!

Edit: added second picture and explanation

Re: Split by 3, 5, 7, 9

Posted: Fri Nov 21, 2014 4:17 am
by Tinyboss
Very nice! :-)

Re: Split by 3, 5, 7, 9

Posted: Fri Nov 21, 2014 4:51 am
by n9103
This ends up being a neatly split result?
Rather simpler than I would've thought in that case, though it does make sense.
Thanks for the pointer. :)

Re: Split by 3, 5, 7, 9

Posted: Fri Nov 21, 2014 4:59 am
by Z903
Yes it is a perfect split. If you put 30 iron in the input you will get 10 out each path of the 3 split.

Even if the input is fully loaded but not if the output is blocked.

Re: Split by 3, 5, 7, 9

Posted: Fri Nov 21, 2014 4:20 pm
by ssilk
I hope it is ok, that I included the pics into the wiki, if not just tell:

https://forums.factorio.com/wiki/inde ... _splitters

:)

Re: Split by 3, 5, 7, 9

Posted: Sat Nov 22, 2014 12:26 am
by The Lone Wolfling
This is similar to how PRNGs generate random numbers in ranges - they generate a certain number of bits and discard if it is above the maximum number. (Sort of like generating a number between 1 and 7 by rolling an 8-sided die and repeating if/when it comes up 8.)

The one thing I will say with this design is that you have to be careful that your belts backwards don't get clogged or you'll lose the nice splitting value.

Re: Split by 3, 5, 7, 9

Posted: Sat Nov 22, 2014 12:45 am
by skomick
Beautiful. I actually bookmarked this topic!

Re: Split by 3, 5, 7, 9

Posted: Mon Dec 01, 2014 10:13 am
by Z903
ssilk wrote:I hope it is ok, that I included the pics into the wiki, if not just tell:

https://forums.factorio.com/wiki/inde ... _splitters

:)
Ya its fine to add them to the wiki

skomick wrote:Beautiful. I actually bookmarked this topic!
Thanks!

Re: Split by 3, 5, 7, 9

Posted: Wed Nov 15, 2017 5:43 pm
by Skoobles
What about the dangling splitter on the 5 split? is there some way I should be connecting that up?

Re: Split by 3, 5, 7, 9

Posted: Wed Nov 15, 2017 7:21 pm
by quyxkh
You could do that, but already everything going through that splitter is recirculating, I assuage my OCD's dislike of the dead end by thinking of the four plates stuck there as the splitter⇒merger conversion cost.

Re: Split by 3, 5, 7, 9

Posted: Wed Nov 15, 2017 8:18 pm
by Jap2.0
No, you don't need to hook it up anywhere. By the way, this thread has been dead for almost 3 years.

Re: Split by 3, 5, 7, 9

Posted: Wed Dec 13, 2017 11:17 pm
by golfmiketango
Skoobles wrote:What about the dangling splitter on the 5 split? is there some way I should be connecting that up?
No such dangle, that splitter does not exist -- what you are seeing is the top and bottom half of two splitters.