Няшная / Говнокод #19833 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
#include<stdio.h>
#include <stdlib.h>
#include<string.h>
#define chess 18
int minimum_possible(int cur_Column,int cur_Row, int extro_board[][chess], int run ),
    check_point(   int row, int column,  int bord[][chess]	),
    cor_hor(int hor_out  ),
    cor_ver(int ver_out);
int main(void) {
	int  step = 1 ,
	     y,x,
	     moveNumber = 1,
	     currentColumn,
	     currentRow,
	     board[chess][chess] = {0 } , p = 1;
	while( p  ) {
		printf("enter the coordinates of the knight y  x: ");
		scanf("%d %d",&currentColumn ,  &currentRow   );
		if (currentColumn <  0  ||  (currentColumn > (chess - 1)   )  ||  (currentRow  <  0 ||  (currentRow > (chess - 1))    ) )  {
			puts("correct the coordinates of the knight from 0 to 11 for x and y");
		} else {
			p = 0;
		}
	}
	while(  	moveNumber  != -1   )  {
		board[currentRow][ currentColumn]  = step++;
		moveNumber =     minimum_possible(currentColumn,currentRow ,board , step ) ;
		currentRow +=   cor_ver(moveNumber);
		currentColumn +=   cor_hor(moveNumber);
	}
	for(x = 0; x <= chess - 1; x++) {
		puts(" ");
		for(y = 0 ; y <= chess - 1; y++)
			printf("%3d ", board[x][y]);
	}
	return 0;
}

обход доски конем метод варнсдорфа ч.1

Запостил: lazy_8 lazy_8, (Updated )

Комментарии (0) RSS

Добавить комментарий

Я, guest, находясь в здравом уме и твердой памяти, торжественно заявляю:

    А не использовать ли нам bbcode?


    8