oh, remco', your test 6 there can't be correct.
it would make last digit as:
...
|..
|..

and to make a zero, we need 4 segments right.
_________________________
!

download KiXnet