1. Список говнокодов пользователя gne4do

    Всего: 25

  2. Си / Говнокод #28862

    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
    95. 95
    96. 96
    97. 97
    98. 98
    int second_buf = 0;
    
      for (; d != 100; d++) {
    
        strcpy((symbolTable + d)->symbol, "0");
        (symbolTable + d)->location = 0;
        (symbolTable + d)->type = 'q';
        mem_smp[d] = 0;
        flags[d] = -1;
      }
    
      printf("%s\n", argv[0]);
    
      file_buf = fopen(argv[1], "r");
    
      for (d = 0; feof(file_buf) == 0; ++d) {
    
        fgets(&buf_data[d][0], 150, file_buf);
      }
    
      fclose(file_buf);
    
      memcpy(copy_buf_data, buf_data, sizeof(char) * 150 * 150);
    
      for (d = 0; buf_data[d][0] != 0; d++) {
    
        buffer = strtok(&buf_data[d][0], " ");
    
        for (; buffer != NULL; buffer = strtok(NULL, " ")) {
    
          if (token_string_count == 0 && my_isdigit(*buffer)) {
    
            count_table_intro = search_in_base(symbolTable, buffer);
    
            strcpy((symbolTable + count_table_intro)->symbol, buffer);
    
            (symbolTable + count_table_intro)->type = 'L';
    
            (symbolTable + count_table_intro)->location = count_table_extra;
          }
    
          if (rem_break(buffer) == 1) {
    
            (symbolTable + count_table_intro)->location = count_table_extra;
    
            break;
          }
    
          else if (my_strcmp(buffer, "let") == 0) {
    
            strcpy(infix, &copy_buf_data[d][7]);
            convertToPostfix_1(infix, postfix);
            save_left_side = let_past(symbolTable, postfix, post_buf);
    
            save_exp = evaluatePostfixExpression_2(post_buf, mem_smp, &count_cmd);
            mem_smp[count_cmd] = (2000 + save_exp);
            count_cmd++;
    
            mem_smp[count_cmd] = (2100 + save_left_side);
            count_cmd++;
    
          }
    
          else if (my_strcmp(buffer, "if") == 0) {
    
            strcpy(infix, &copy_buf_data[d][5]);
            intro_buffer = strtok(infix, " ");
            second_buf = 0;
            for (count_if = 0, sign_ch = 1, ab = 0; intro_buffer != (char *)'\0';
                 intro_buffer = strtok(NULL, " "), count_if++) {
    
              if (!my_strcmp(intro_buffer, "goto")) {
                goto_flag = 0;
                intro_buffer = strtok(NULL, " ");
    
                second_buf = goto_search(symbolTable, intro_buffer);
    
                if (second_buf == 0) {
                  second_buf = atoi(intro_buffer);
                  goto_flag = 1;
                }
    
              }
    
              else if (strstr(comparison_signs, intro_buffer)) {
                ab = intro_buffer[0] + intro_buffer[1];
    
                sign_ch = !(ab == 60);
    
              }
    
              else if ((isalnum(*intro_buffer))) {
    
                past_in_table_cons_or_value(symbolTable, intro_buffer);
    
                val_if[cnt++] = search_in_table(symbolTable, intro_buffer);
              }
            }

    Симплтрон из задачи Дейтелов
    2

    gne4do, 02 Октября 2023

    Комментарии (0)
  3. Си / Говнокод #28861

    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
    95. 95
    96. 96
    97. 97
    98. 98
    #include <ctype.h>
    #include <math.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    
    int evaluatePostfixExpression_2(char *, int memory_smp[], int *count_command);
    int calculate_2(int, int, char, int memory_smp[], int *count_command);
    
    typedef struct mode_intro {
      int type;
      int data[2];
    
    } expr_if;
    
    int main(int argc, char *argv[]) {
    
      expr_if rn_data[125];
    
      /*  !=   */
      rn_data[94].type = 2;
      rn_data[94].data[0] = 4100;
      rn_data[94].data[1] = 4100;
      /*  !=   */
    
      /*  ==   */
      rn_data[122].type = 1;
      rn_data[122].data[0] = 4200;
      /*  ==   */
    
      /*  <=   */
      rn_data[121].type = 2;
      rn_data[121].data[0] = 4200;
      rn_data[121].data[1] = 4100;
      /*  <=   */
    
      /* < Øèâîðîò íà âûâîðîò  */
      rn_data[60].type = 1;
      rn_data[60].data[0] = 4100;
      /*  <   */
    
      /*  >=   */
      rn_data[123].type = 2;
      rn_data[123].data[0] = 4200;
      rn_data[123].data[1] = 4100;
      /*  >=   */
    
      /* > */
      rn_data[62].type = 1;
      rn_data[62].data[0] = 4100;
      /* > */
    
      char infix[150];
      char postfix[150];
    
      int line_simple_comands_input_print(int cmd, data *table, int token,
                                          int memory[]);
    
      int past_in_table_cons_or_value(data * table, char *str_tok);
      int ab = 0;
      int swp = 0;
      int goto_search(data * table, char *token);
    
      int search_cmd(char *dict[15], char *token);
      char *comparison_signs = "> < <= >= == !=";
      int token_string_count = 0;
      data symbolTable[100];
    
      int cnt = 0;
      int d = 0;
      int count_if = 0;
      int flags[100];
    
      int mem_smp[100];
      char copy_buf_data[150][150] = {{0}};
      char post_buf[150];
      int count_cmd = 0;
    
      int sign_ch;
      FILE *file_buf;
    
      char *buffer = 0;
      char *intro_buffer = 0;
      int save_left_side = 0, save_exp = 0;
      int goto_flag = 0;
    
      int count_table_intro = 0;
      int count_table_extra = 0;
      char name_file[100];
    
      char buffer_postfix[150];
      char buf_data[150][150] = {{0}};
      int val_if[3] = {0};
    
      int data_if[150] = {0};
    
     data_if[60] = 4100;
     data_if[61] = 1;

    Симплтрон из задачи по Дейтелам
    1

    gne4do, 02 Октября 2023

    Комментарии (1)
  4. Assembler / Говнокод #28430

    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
    95. 95
    96. 96
    97. 97
    98. 98
    99. 99
    includelib  C:\Irvine\User32.Lib
    includelib  C:\Irvine\Kernel32.Lib
    includelib  D:\masm32\lib\Irvine32.lib
    include     \masm32\include\Irvine32.inc
    ; D:/masm32/bin/ml.exe /c  /coff  "D:\asm\simple.asm"
    ; D:/masm32\bin\link.exe /subsystem:console  "D:\asm\simple.obj"
    .data
    X Dword  ? 
    A dword  ? 
    B dword  ?
    M dword  ? 
    .code
    main PROC
    mov eax, 1
    xor ecx , ecx
    xor ebx, ebx
    strt:
    add eax , 1
    mov X, eax
    push eax
    call simple
    cmp ebx, 1
    pop eax
    je ext
    call WriteInt
    call CrLF
    ext:
    
    cmp eax, 50000000
    jb strt
    
    	exit
    main ENDP
    Simple PROC uses ecx
    Mov A, 1
    call Sqrt
    Mov A , eax
    MOV edx , 2
    rn:
    ;push edx
    mov ecx, edx
    
    mov eax , X
    mov ebx, edx
    xor edx ,edx
    div ebx 
    cmp edx, 0
    jne stp
    mov ebx ,1
    jmp var
    stp:
    ;pop edx
    mov edx,ecx
    cmp edx, A
    inc edx
    jb rn
    var:
    ret
    Simple  ENDP
    Sqrt PROC USES ebx
      mov A, 1 ;A = 1
      mov  eax ,X
      push eax
      shr  EAX, 5
      add   EAX , 8
      Mov B , EAX
      pop eax
      cmp B,0FFFFh
      jbe crt
      mov B, 0FFFFh
    crt:;do {
        mov ebx, B 
    	push A
    	add A,ebx
    	shr A, 1
    	mov ebx, A
    	pop A
    	mov M ,ebx
    	mov eax, ebx
    	mul ebx
    	cmp eax , X
        jbe  opt	
    	Mov eax, M
    	dec  eax
    	mov B , eax
    	jmp dz
    	opt:
    	mov eax, M
    	inc  eax
    	mov A , eax
    	dz:
    	mov eax, B
    	cmp eax,A
    	Jae crt
    	mov  eax , A 
    	dec eax
    	ret
    Sqrt  ENDP
     END main

    Лялька для простых чисел )))))))))

    gne4do, 27 Октября 2022

    Комментарии (1)
  5. Куча / Говнокод #27778

    0

    1. 1
    https://twitter.com/RCS/status/1452367702727831565

    Ай, Молодца !!!

    gne4do, 31 Октября 2021

    Комментарии (1)
  6. Куча / Говнокод #27698

    0

    1. 1
    2. 2
    "Эффективный C. Профессиональное программирование"  Роберт Сикорд.
    Фуфел или новая "белая книга" ?

    gne4do, 02 Октября 2021

    Комментарии (3)
  7. Куча / Говнокод #24928

    −1

    1. 1
    Давайте ругать питон, он мне со своими отступами все мозги выебал.

    gne4do, 17 Октября 2018

    Комментарии (12)
  8. Си / Говнокод #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)
  9. Си / Говнокод #24408

    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
    int search_cross_pnt(char cross_point[LN] , int *point   ,char *content[PL] , int in_x, int in_y      ){
    		int x = 0;
    		int y = 0;
    		int m = 0;
    		int key = 0;
    				
    	  	for(x = 0; x <= PL - 1 ; x++)  {
    		   y = strlen(content[x] ) ;
    		   
    		   			for(  m = 0; m <= y; m++ ){
    		   	
    			   
    			   
    			   if(      (   *(cross_point + m ) !=    *(*(content + x ) + m )       &&    *(cross_point + m )  != 0   )   ||    
    			   
    			  				( ((  in_x  + y )  > (X - 1)  )       ||      (  (  in_y  + y  ) > (Y - 1) )  )     ) {
    							  key = 0;
    							  break;
    				} 
    	
    	
    			
    			if( *(cross_point + m )  ==    *(*(content + x ) + m )){
    				  	key++;
    				  } 
    	
    			
    			
    			if( m  ==  y ){
    				*point = x ;   return key ;
    				}
    	           }
    	}
    return 0;
    }
    
    void write_horizantal ( int x , int y      ,char board[][Y] , char *content         ){
    					while( *content  ){
    					*( *(board + x) + y++ )   =    *content++   	   ;  
    				}
    			}
    	
    	void write_vertical( int x , int y  , char board[][Y] , char *content   ){
    			while(    *content  ){
    						 *( *(board + x++ ) + y)     =    *content++   ;  
    				}
    			}
    
    
    	
    	int checking_space_null (char board[][Y] , int mem ,int sh, int br  ){
    		int	slc = 0;
    	
    		if(      	
    		 	 (          board[  ( sh   )     -  br  ][mem  -  1 ] != 0   ||    board[  ( sh   )     -  br  ][mem  +  1 ] != 0     ) &&    
    			   
    			  board[  ( sh   )     -  br  ][mem ]  == 0    )  { 
    					slc = 1;
    				}
    	return slc;
    		}
    
    	int checking_space_one (char board[][Y] , int mem ,int sh, int br ){
    		int	slc = 0;
    			if(      	
    	           
    			   (   board[   mem  -  1   ][  ( sh   )     -  br ] != 0  ||   board[ mem     +  1   ][      ( sh   )     -  br  ] != 0     ) &&    
    			   
    			   
    			     board[  mem    ][  ( sh   )     -  br    ] == 0   	
    		 																 )  {
    					slc = 1;
    			} return slc;
    		}

    дегенератор кроссворда 2 ч.

    gne4do, 22 Июня 2018

    Комментарии (0)
  10. Си / Говнокод #24407

    −1

    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
    #include<stdio.h>
    #include<stdlib.h>
    #include <time.h>
    #include <locale.h>
    #include <string.h>
    #include <ctype.h>
    #define PL 300
    #define X 35
    #define Y 35
    #define LN 15
    #define MN 2
    
    	int main(void){ 
    
    		char *words[PL] = {
    			"гарпия","ястреб", "самоходка","снайпер","медведь","баркас","ельцин", "пушкин","рязанов","рузвельт","вагонетка","богатырь", "галстук","мебель","вождь","кобра","журналист", "валюта","кабель","реванш", 
    			"фляжка","пирожок", "гайдай","люстра","соль","вантуз","дерево", "крантик","гитара","спилберг", "пижон","европа", "достоевский","самокрутка","адвокат","колыбель","калькулятор", "освальд","остановка","фикус", 
    			"вавилен","мыщъх", "озборн","ильинский","пархоменко","связка","стекло", "крепеж","тайсон","мэйсон","николай","глушитель", "сапфир","служанка","стояк","пфайфер","градусник", "стамбул","маядзаки","эйзенхаур", 
    			"али","колбаса", "яжевика","совок","число","кобель","ожог", "страница","ваучер","пафос", "самокат","хвостик", "дурында","пучков","дворкович","барабас","сурков", "шут","асфальт","токио", 
    			"лепесток","удав", "выстрел","калибр","улов","копенгаген","осло", "калипсо","грунт","процент", "блоха","след", "пружина","монтажник","экран","боромир","оскар", "бобик","курасава","никсон", 
    			"сталкер","ягодица", "глазок","шмель","геринг","монро","бондаренко", "стрела","носок","мачетэ","шпицберген","сталь", "монолит","случай","зуб","малохит","клубника", "золото","чехов","диск", 
    			"форд","чубайс", "пелевин","юматов","молоток","демократия","сократ", "геродот","невзоров","сорокин","макконохи","быков", "штанга","гвоздь","весло","табурет","вопрос", "колдовство","обида","смерчь", 
    			"блэкмор","тезка", "зубик","сноха","порше","тормоз","туше", " сигал","баярский","китано", "лунаход","гагарин", "синематограф","жим","электрика","веретино","шахматы", "кувшин","букварь","символ", 
    			"башня","котенок", "револьвер","леннон","тигр","телефон","хамелеон", "матрас","зубр","техникс","леонов","коппола", "овчарка","ауди","сфинкс","матрос","ленин", "доберман","фролово","банан", 
    			"самосвал","куба", "амстердам","клык","шпиль","мука","край", "чатский","бугур","паскаль","альпы","лодка", "транспорт","гиря","шпагат","боцман","мауддиб", "игра","крыло","окно", 
    			"одежда","кольцо", "монитор","гриб","тетрис","человек","обезьяна", "шахматы","кинг","эллрой","кобейн","немезида", "ванна","волонтер","эхо","икота","пена", "звук","сьемка","отстойник", 
    			"мачо","конверт", "снаряд","писатель","поисковик","бегун","бетон", "коллапс","пожарник","сигнал","балоболка","свекровь", "спойлер","запас","морковь","питбуль","кемерово", "загон","юпитер","вашингтон", 
    			"труба","статуя", "дверь","агрегат","мачта","корень","волчара", "корова","маскит","радзинский","канада","челюсть", "сейлормун","ньютон","дзержинский","шестерня","валькирия", "компот","адам","матрица", 
    			"бетховен","пудель", "деталь","коломбо","рахит","монголия","колба", "конфета","енот","груздь","наполеон","вертухай", "сковородка","гейша","мост","гриль","комедия", "кубрик","ганапольский","паук", 
    			"скороход","крым", "ротшильд","гайдар","пешка","козырь","дерижабль", "магнезия","магнум","рогатка","гайка","штопор", "перевертыш","репортаж","москва","дзедун","меньшов", "пиксель","розетка","гарем", 
    			};
    
    		srand(time(NULL));
    
    		setlocale( LC_ALL,"Russian" );
    
    		void write_vertical( int x , int y , char board[][Y] , char *content );
    
    		void write_horizantal( int x , int y ,char board[][Y] , char *content );
    
    		void(*write[ MN])( int x , int y ,char board[][Y] , char *content ) = {write_vertical,write_horizantal};
    
    		int search_cross_pnt(char cross_point[LN] , int *point   ,char *content[PL] , int in_x , int in_y );
    
    		int checking_space_null (char board[][Y] , int mem ,int sh, int br  );
    
    		int checking_space_one  (char board[][Y] , int mem ,int sh, int br );
    
    		int (*chk_mask[ MN])(char board[][Y] , int mem ,int sh, int br ) = { checking_space_null    ,  checking_space_one  } ;
    
    		int search_cross_pnt(char cross_point[LN] , int *point   ,char *content[PL] , int in_x , int in_y  ) ;
    
    		int n_x = 2   ,   n_y   =  3  ;
    
    		int kk = 0;
    
    		int first =   first = 1 +  rand() % 299 ;
    
    		int lng = strlen(words[first]) ;
    
    		char crossboard[X][Y] = {" "} ;  
    
    		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 ) );      
    			
    
    	write_horizantal( n_x ,  n_y    ,  crossboard , words[first]       );  
    	
    	words[first]   = " ";
    
    	for(removing_mask(  &n_x  , &n_y , &lng  , crossboard , words , kk %  MN , write[kk %  MN] , search_cross_pnt , chk_mask[kk %  MN]   ); 
    			
    			removing_mask(  &n_x  , &n_y , &lng  , crossboard , words , kk %  MN  , write[kk %  MN] , search_cross_pnt , chk_mask[kk %  MN]   )  ; 	                                               
    			
    			kk++ 
    		
    		) ;
    	    		
    				
    			for( n_x  = 0 ;n_x  <= X - 1 ; n_x ++, puts(" ")   ){
    				for(n_y = 0 ;n_y <=   Y  - 1 ;  n_y++ ){
    						     printf("%c " ,  crossboard[n_x ][n_y ]   )  ;	
    					}
    			}
    
    return 0;
    }

    Якобы генератор Кроссворда 1

    gne4do, 22 Июня 2018

    Комментарии (192)
  11. Си / Говнокод #23400

    +6

    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
    #include<stdio.h>
    #include<stdlib.h>	
    #include<string.h>	
    	int main(void){
    	void run_func(char *map[], char *fnt  , char *km , float *x ,  float *y , int line , int row , int lift    );
    				char *long_met[3][8] = {{"mile","0.621371"  ,  "yard","1093.61" , "fut","3280.84" , "duim","39370.1" } ,
    							{ "mile" ,"1.60934" , "yard","0.0009144" ,  "fut","0.0003048" ,  "duim","0.0000254"},
     			   				{"kilometer","1"  , "meter","1000"  ,   "stmeter","100000" ,   "mmeter","1000000" } }; 
    				char *amount[3][4] = { { "gallon" , "0.264172" ,       "quarta" , "1.05669"     } , 
    						{"gallon" , " 3.78541"  ,     "quarta" , "0.946353"   },
    						{"litr" , "1"  , "mililitr" , "1000"   }};
    				char *mass[3][8] = {   {"eng.tonna","0.984207"  ,  "amer.tonna","1.10231" , "stone","157.473" , "funt","2204.62" } ,
       						{ "eng.tonna" , "1.01605" , "amer.tonna", "0.907185" ,  "stone","0.00635029" ,  "funt","0.000453592"},
    						{"tonna","1" ,         "kilogram" , "1000"  , "miligram","100000"   , "microgram","1000000"  }}; 
    				char **cp;
    				char *buf_data;
    				char *fnt_sys;
    				char *mtr_sys;
    				char *word[100];
    	while(1){
    	int bg  = 0,convert_ch = 3,y = 0, d = 0, numb = 0;
      	float mn =0  , xm = 0 ;
    	printf("%s", "enter data for converter: ");
    		fgets( (char *) word, 99 ,stdin);
    		buf_data = strtok((char *) word, " ");
    		if( ! strcmp(buf_data, "funt.sys"   )     ){
    		convert_ch = 0;	
    		}
    		else	if( ! strcmp(buf_data, "metric.sys"    )     ){
    			convert_ch = 1;	
    		}
    		for( bg = 0 ;  buf_data != NULL;  buf_data = strtok(NULL, " ")  , bg++ ) {
    			switch(bg){
    				case 1:
    					if( !strcmp("long_met" , buf_data  )  ){
    			  			 y	=   sizeof(*long_met) / sizeof(long_met[0][0]); 
    	          	      	                 d	=   sizeof(long_met) /   sizeof(long_met[0][0]); 
    			  		        cp  = &long_met[convert_ch][0]  ;
    					}
    			   		else if(!strcmp("amount" , buf_data  ) ){
    			  			 y	= sizeof(*amount) /  sizeof(amount [0][0]); 
    		            	                 d	= sizeof(amount) /  sizeof(amount[0][0]); 
    				    	        cp = &amount[convert_ch][0] ;
    					}
    				 	else if(!strcmp("mass" , buf_data  ) ){
    				  		 y	= sizeof(*mass ) /  sizeof(mass[0][0]); 
    		         		         d	= sizeof(mass ) /  sizeof(mass[0][0]); 
    				 		 cp = &mass[convert_ch][0] ; 
    					}
    					break;
    				case 2:
    				fnt_sys = buf_data;
    					break;
    				case 3:
    				mtr_sys = buf_data;
    					break;
    				case 4:
    				numb =   atoi(buf_data);
    					break;
    			}
    		}
    		if( !y || !d || !cp || convert_ch == 3 || !numb ){
    	
    			puts("error");
    		}
    		else{
    			run_func( cp,   fnt_sys ,  mtr_sys , &mn ,  &xm , y  , d , convert_ch );
    			if( !mn || !xm  ){
    		puts("error");
    				} else{
    			printf("%f\n" , !convert_ch  ?    (mn  /  xm ) * numb :  (  mn  *  xm   ) * numb         );	
    			}
    		}
    	}
    	return 0;
    	}
    	void run_func(char *map[], char *fnt  , char *km , float *x ,  float *y , int line , int row  , int lift    ){
    		int m ;
    	if(  ( lift )   ){
    			row    -= line;	
    		}
    	for(  m = 0 ; m <= line   ; m++){
    		if(!strcmp(fnt,map[m])){
    			*x = atof(map[m  + 1] )  ;
    			break;
    			}
    		}
    	for( m =   (row  - line) ; m <=  row - 1  ; m++){
    		if( !strcmp( km   ,  map[m] ) ){
    			*y = atof(map[m  + 1 ] );
    			break;
    				}
    			}
    		}

    gne4do, 11 Октября 2017

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