Here is a goal: How to find studs in a wall

How would you accomplish this goal?
Move a magnet along a wall, when the magnet clings to the wall, its found a nail and you have found a stud.