Thread: Help About Nested Loop

  1. #16
    Registered User
    Join Date
    Mar 2006
    Posts
    725
    Simple -- 32-bit compilers compile programs for 32 bit platforms, et al. Turbo C is a 16-bit fossil because most people nowadays don't ever use 16-bit platforms any more
    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
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    64 bit compilers might take advantage of some features that exist only on 64 bit processors, so you probably won't be able to run programs compiled with them on 32 bit processors.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. nested loop, simple but i'm missing it
    By big_brother in forum C Programming
    Replies: 19
    Last Post: 10-23-2006, 10:21 PM
  2. Nested for loop...search & display a list within a list
    By chadsxe in forum C++ Programming
    Replies: 13
    Last Post: 07-20-2005, 01:34 PM
  3. output from nested while loop
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 08-22-2002, 09:30 AM
  4. How to change recursive loop to non recursive loop
    By ooosawaddee3 in forum C Programming
    Replies: 1
    Last Post: 06-24-2002, 08:15 AM
  5. Need help with simple programs...
    By BCole19 in forum C++ Programming
    Replies: 22
    Last Post: 08-30-2001, 09:45 PM