Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(int argc, char* argv[])
- {
- if( argc != 2 )
- {
- printf("Nie dodales pliku z głebokosciami");
- return 5;
- }
- char* fp = argv[1];
- int** tab = NULL;
- if( !Create(&tab, N, M) )
- {
- printf("nie udało sie zrobic tablicy");
- return 3;
- }
- int** path = NULL;
- if( !Create(&path, N, M) )
- {
- printf("nie udało sie zrobic tablicy");
- return 3;
- }
- SetTab(fp, tab, N, M);
- #ifdef _DEBUG_
- Print(tab, N, M);
- printf("\n\n");
- #endif _DEBUG_
- int portX = N - 1; //cel podrozy statkiem xd
- int portY = M - 1;//destination <3
- if( !root(tab, N, M, tab[0][0], 0, 0, path, portX, portY) )
- {
- printf("** Nie ma mozliwosci doplynac do portu!!\n\n");
- return 23;
- }
- printf("Nasza sciezka wyglada tak:\n");
- for( int i = 0; i < N; i++ )
- {
- for( int j = 0; j < M; j++ )
- printf("%d ", path[i][j]);
- printf("\n");
- }
- Delete( &tab, N);
- Delete( &path, N);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement