new binary algorithm

From: Andre Coelho
Date: Sun Jul 05 2020 - 22:08:39 EST


hey,


for those who read my email, i upgraded tjhe algorithm

here it is

#include <stdio.h>


Â// The algorithm works by first getting a base of 0000, and change one bit at a time (0001,0010,etc);
// Then it uess a base of 1111 and change one bit at a time (1110,1101,etc...)


int main() {
ÂÂÂ char zeros[] = { '0','0','0','0','0','0','\0'};
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ Âchar ones[] = { '1','1','1','1','1','1','\0'};

ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ Âprintf("\n%s",zeros);

ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ Âint iterator;

ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ Âfor (iterator=0 ; iterator < (sizeof(zeros)-1) ; iterator++) {
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ zeros[iterator] = '1';
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ printf("\n%s",zeros);
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ zeros[iterator] = '0';
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ }
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ Âprintf("\n%s",ones);

ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ Âfor (iterator=0 ; iterator < (sizeof(ones)-1); iterator++) {
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ones[iterator] = '0';
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ printf("\n%s",ones);
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ones[iterator] = '1';
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ }
}