From cement cohesion to DNA condensation, a proper statistical physics treatment of systems with long range forces is important for a number of applications in physics, chemistry, and biology. We compute here the effective force between fixed charged macromolecules, screened by oppositely charged mobile ions (counterions). We treat the problem in a one dimensional configuration, that allows for interesting discussion and derivation of exact results, remaining at a level of mathematical difficulty compatible with an undergraduate course. Emphasis is put on the counter-intuitive but fundamental phenomenon of like-charge attraction, that our treatment brings for the first time to the level of undergraduate teaching. The parity of the number of counterions is shown to play a prominent role, which sheds light on the binding mechanism at work when like-charge macromolecules do attract.