I made a circuit computer, which determines if the number of all items in a chest is a prime number, then it will light up green. Otherwise it will light up red. The power pole is just to indicate where is the index which goes from 2 to the number of items (the largest among all sorts of them).
https://factorioprints.com/view/-L2qdWZACpEIgd6i-7Ex
Prime number checker
-
- Manual Inserter
- Posts: 2
- Joined: Sun Jan 14, 2018 9:45 pm
- Contact:
Re: Prime number checker
Here is a smaller and faster version, using the new "modulo Each" operator. It works for up to 160,000 items.
Last edited by DaveMcW on Fri Mar 26, 2021 11:33 am, edited 1 time in total.
-
- Manual Inserter
- Posts: 2
- Joined: Sun Jan 14, 2018 9:45 pm
- Contact:
Re: Prime number checker
Nice!
Mine works itemwise, it checks if there is a prime amount of every item. But it is much slower
Mine works itemwise, it checks if there is a prime amount of every item. But it is much slower