How to use Z state in programming ?

i m a newbee to arduino. i know the theory behind charlieplexing but donot know how to configure hi impedance state in programs.
Can anybody share a link having a program which controls(individually) say 6 leds from 3 pins?
Thanks for the click.

To set an output pin to 'high impedance' just change it to an input.

AND make sure it's set to LOW. Setting it HIGH will enable a pullup, and then it's a fourth state: weakly on.