Skip to content

Instantly share code, notes, and snippets.

@stpettersens
Created December 2, 2010 23:10
Show Gist options
  • Save stpettersens/726292 to your computer and use it in GitHub Desktop.
Save stpettersens/726292 to your computer and use it in GitHub Desktop.
Why not incrementing z?
while(1) {
strcpy(fsm.state[x][z], lines[i]);
printf("%i %i\n", x, z);
z++; i++;
if(strcmp(lines[i], ".") == 0) x++; z = 0;
if(strcmp(lines[i], "") == 0) break;
}
@stpettersens
Copy link
Author

Output is:

1 0
1 0
1 0
2 0
2 0
2 0
3 0
3 0
3 0

Need to have:

1 0
1 1
1 2
2 0
2 1
2 2
3 0
3 1
3 2

... etc ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment