A pendulum swings with a very small angle above a plane with three magnets. The trajectory of the green bob at the end of the pendulum is shown. You can move the red magnets or change the initial position of the bob. The pendulum's wire is not drawn.
In general the behavior is quite unpredictable, but in some cases, for instance when the friction is high, it is easy to forecast which of the magnets the bob will be attracted to. The force that a magnet applies to the pendulum is inversely proportional to the square of the distance.