C Programming Puzzle
Monday December 1, 2008
What does this piece of C code do? It's from a book and provided as an example of how not to layout code because it looks horrible.
main(int v,char**c){
if(--v){
main(v,c) ; c[v][0]^=0x80;
for(c[0][0]=0;c[++c[0][0]]!=0;)
if(c[c[0][0]][0]>0)
puts(c[c[0][0]]) ;
puts("-- ") ;
main(v,c) ;}}
Answer on Wednesday!
- Link to C Tutorials


It’s a Hanoi tower.
what parameters need to be passed to this program
It’s a application of Hanoi tower, to find all combination of list of argument.
Use c[0][0] is not very clean for system.
i wanted to make puzzel game with c but i had trouble in making its pieces correct. what should i do?