Thread: <strings.h>

  1. #16
    Registered User
    Join Date
    Mar 2006
    Posts
    725
    Whoops...

    Writing one should be trivial, but it's unnecessary. Get a better compiler, or update your linker files.
    Last edited by jafet; 06-13-2006 at 03:26 AM.
    Code:
    #include <stdio.h>
    
    void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){
    puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9
    /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i]
    ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][
    t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}

  2. #17
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    One more time... stricmp() isn't part of the C standard.

    Write your own.
    Sent from my iPadŽ

Popular pages Recent additions subscribe to a feed