How gauss rifles work
The simplest gauss rifle is made by placing two steel balls behind a magnet and putting another steel ball slightly in front of the magnet. When the first ball is drawn toward the magnet the collision will cause the second ball on the other side of the magnet to fly off. By placing several groups of magnets and balls in a straight line, an increase in speed can be gained from one collision to the next.
Gauss rifles don't have any uses besides entertainment.
A ball being pulled into a magnet has some amount of force. When it collides with the magnet some of that force is transferred to the last ball in the chain. The last ball in the chain will never have more force than the ball being pulled into the magnet, and for that reason you will never get any impressive speeds. However, I thought it would be interesting to get the most speed possible without using electromagnets. I tested a many different setups involving different amounts of magnets, different strength magnets, different amount of balls and different sized balls. The following are my findings.
Magnets should be placed as close together as possible. If the magnet/ball groupings are placed too close together, balls from one group may spontaneously fly toward another.
Align the magnetic fields of all the magnets in the same direction.
Number of balls
More balls behind the magnet create higher speed because less force is needed to push them away from the magnet. However, too many balls will cause less than the full allowable amount of energy to be transferred to the last ball. My experiments showed that the optimal number of balls to place behind each magnet is the number in which the magnet can suspend in a vertical line.
The fourth ball is falling off because the magnet can't hold it. For this strength magnet you should use three balls:
Stronger magnets are better. Rare earth magnets like neodymium magnets are the best.
Balls the same size as the magnets are best. The best arrangement of balls actually involves multiple sizes.
If there are a limited supply of strong magnets and you wish to use weaker magnets as well as strong ones, put the weaker ones at the beginning of the rifle.
Limited number of balls
If there is a limited number of total balls, you should place the optimal amount of balls at the beginning until you run out, allowing two balls for any remaining magnets. For instance, if your magnets hold five balls vertically and you have four magnets but only twelve balls, make your setup like this: five balls behind the first magnet, three balls behind the second and two balls behind the third and fourth.
If a combination of ball sizes is available, use bigger balls immediately after the magnet but one small ball at the end of every lineup. You should test to see how many big balls plus one small ball your magnets can hold vertically. This arrangement will cause the small ball to be the one that is actually jettisoned into the next magnet.
Limited different balls
If you have a limited number of different balls, use the big ones at the beginning of the rifle.