1. Си / Говнокод #24409

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    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
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    int  removing_mask (int *x , int *y, int *lng  , char board[][Y], 
    					char *content[PL] , int select, void   (*write  )( int x , int y  ,char board[][Y],
    					char *content)  , int search_cross_pnt(char cross_point[LN] , int *point   ,char *content[PL] , int in_x , int in_y) , 
    					int (*chk_mask )(char board[][Y] , int mem ,int sh, int br )
    					   ){
    	char mask_word[LN] = {0}  ;
    	int sm = 1;
    	int lvl   =  0;
    	int shift =  0;
    	int brd = 0;
    	int mem = 0;
    	int stp = 0;
    	int mn = 0;
    	int bi = 0;
    	int rd = 0;
    	int gor = 0 ,vert = 0;
    	int pnt = 0;
    	int hg  = 15;
    	int	sr = 0;
    	int *one_value = 0  , *second_value = 0;
    	int ctr = 0;
        
    	if(select == 0 ){
    	  mem = *y;
    	  hg  = 	  *y < LN	 ?  *y : hg    ;
    	}
    	else   {
    		mem = *x;
    		hg  = 	  *x < LN	 ?  *x : hg    ;
    	
    	}
    	
    	for(   lvl = 0     ,rd = 0; lvl <= *lng  - 1    ;      lvl++  ,mem++	  ){
    		 
    			for(brd = 0  ;    brd  <= hg  ; brd++           ){
    			 	  	
    			 select == 0 ? ( shift = *x ,    one_value = &sr ,   	second_value  =  &mem) :  (shift = *y       ,  one_value = &mem ,   	second_value  = &sr  ) ;
    	
    	if(	 (select == 0 && board[ shift - 1][ *second_value ]  == 0  )  ||  (select == 1 && board[*one_value  ][shift  - 1 ]   == 0    )){
    		
    		for(    pnt = 0, stp = 0;   stp  <= LN  ;stp++     ){
    				   	  
    			if ( 	 chk_mask  ( board  , mem    ,   shift ,  brd  )   == 1   ){
    						 pnt = 1;
    						
    						break;
    				}	
    					sr = shift++ - brd ;
    					mask_word[stp] 	 = 	board[    	*one_value      ][ 	*second_value   ]  ;
    				}
    		     
    	     	}   	 
    				if(pnt == 1 ){
    				     	break;
    					 }
    
    				sm =  search_cross_pnt( mask_word   ,&mn , content  ,*x, *y  ) ; 
    
    			 	if(  sm > bi   ){
    					
    				
    				    select == 0 ? (  gor   =	*x - brd, vert   = 	mem)	: (gor   =	    mem  ,vert   =  *y - brd) ; 
    			        
    					bi = 	sm   ;
    				    rd = mn; 
    			     }
    				}
    			}		 
    			if(  (select == 1 &&  isalpha(board[gor][vert -  1]  ) ||
    			    
    				 (select == 0 &&  isalpha(board[gor - 1 ][vert] )) ||
    				
    				 ( gor && vert  )   ==  0 
    							) ) { 
    			ctr = 1;
    		}
    		if(  ( (    content[rd]   != " " ) )  && 
    			
    			( board[gor ][vert ]  ==  content[rd][0] || !isalpha (board[gor ][vert ]  )  ) 
    		
    			&& !ctr 
    		
    		) {
    			
    			*x = gor  ;   
    			*y = vert ;
    			*lng =   strlen(content[rd ]); 
    			write( gor   , vert    ,  board ,     content[rd]     );
    					content[rd] = " ";
    					return 1 ;
    			}
    	
    			return 0;
    	}

    полный аут кроссворду 3 ч.

    Запостил: gne4do, 22 Июня 2018

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

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