logo
Диссертация_2013_Даулбаева ММ

Продолжение приложения а

  1. case 1:

  2. printf("Search to the right --->");

  3. fprintf(fil,"Search to the right --->");

  4. if((nst = prpoisk(ik,jk))>=0)

  5. {

  6. printf("founded\n\r");

  7. fprintf(fil,"founded\n");

  8. if((top2=(struct cik*)malloc(sizeof(struct cik)))==NULL)

  9. abort();

  10. if(!topnast1) topnast1=top2;

  11. else top3 -> next=top2;

  12. top3 = top2;

  13. top2 -> next = NULL;

  14. top2->ick = ik;

  15. top2->jck = jk;

  16. ch++;

  17. top2->prnapr = 1;

  18. pr("top2",top2);

  19. napr = 2;

  20. jk = nst;

  21. perpr = perlev = 0;

  22. } // **** IF *******

  23. else

  24. {

  25. fprintf(fil,"Point not found ! Change direction to LEFT\n");

  26. napr = 3;

  27. perpr = 1;

  28. }

  29. break;

  30. //***************** PRODOLZHENIE 2 POISKA ******************************

  31. case 2:

  32. printf("Search to the down --->");

  33. fprintf(fil,"Search to the down --->");

  34. if((nstr=nizpoisk(ik,jk))>=0)

  35. {

  36. if((top2=(struct cik*)malloc(sizeof(struct cik))) == NULL)

  37. abort();

  38. printf("founded\n\r"); fprintf(fil,"founded\n");

  39. if(!topnast1) topnast1=top2;

  40. else top3->next=top2;

  41. top3=top2;

  42. top2->next=NULL;

  43. top2->ick = ik;

  44. top2->jck = jk;

  45. ch++;

  46. top2->prnapr = 2;

  47. pr("top2",top2);

  48. napr = 3;

  49. ik = nstr;