solvemind.c
int nextCode(Code *code) {
    //increment code "little endian"
    int i = 0;
    //increment cascades up to fitting spot
    while(code->colors[i] >= COLOR_COUNT - 1) {
        code->colors[i] = 0;
        i++;
    }

    //overflow occurred
    if(i >= CODE_LENGTH) return 0;

    code->colors[i]++;
    return 1;
}
//this function allows iterating all codes
this function allows iterating all codes
this function allows iterating all codes
int nextCode(Code *code) {
    int i = 0;
    while(code->colors[i] >= COLOR_COUNT - 1) {
        code->colors[i] = 0;
        i++;
    }
    if(i >= CODE_LENGTH) return 0;
    code->colors[i]++;
    return 1;
}
int nextCode ( Code * code ) { int i = 0 ; while ( code -> colors [ i ] >= COLOR_COUNT - 1 ) { code -> colors [ i ] = 0 ; i ++ ; } if ( i >= CODE_LENGTH ) return 0 ; code -> colors [ i ] ++ ; return 1 ; }
this function allows iterating all codes
this function allows iterating all codes
//increment code "little endian" //increment cascades up to fitting spot //overflow occurred