rc variables are lists, and $#var evalulates to the length of the list... you can use that to make counters by concatenating elements to a list:
term% a=() while(! ~ $#a 13){echo $#a $a; a=(1 $a);} 0 1 1 2 1 1 3 1 1 1 4 1 1 1 1 5 1 1 1 1 1 6 1 1 1 1 1 1 7 1 1 1 1 1 1 1 8 1 1 1 1 1 1 1 1 9 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1 1 11 1 1 1 1 1 1 1 1 1 1 1 12 1 1 1 1 1 1 1 1 1 1 1 1 -- cinap