Code that "breaks" arduino

bperrybap:
So rather than hook all the wires to a common ground on the far end, you connect a separate Arduino pin to each wire on the far end.

Not sure I have enough pins for this, unless there's a way to distinguish between discontinuity and the wire simply not existing.