Algorithm. Incrementing a binary counter [00SY]

Here is an algorithm to solve the binary counter problem.

i \gets 0
\mathsf {while} B[i] = 1:
B[i] \gets 0
i \gets i+1
B[i] \gets 1