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

    Всего: 1

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

    +130

    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
    char* obrab_stroki(char*, int);
    int move(char*);
    int action_register(char*);
    int speed(char*);
    int condition(char*);
    
    char answer1[25];
    uint8_t Output[512];
    uint32_t number_for_output=16;
    typedef struct { char *name; uint8_t adress; } struct_label;
    typedef struct { char *name; uint8_t adress; } struct_goto_label;
    //----------------------------------------------------------------------------------------
    while (strcmp(qwerty[++string_count],""))
    	{
    		str=obrab_stroki(qwerty[string_count], 0);
    		printf("s:%s\n",str);
    		
    		if (!strcmp(qwerty[string_count]+strlen(qwerty[string_count])-1,"{")) fig_skob++;
    		if (!strcmp(qwerty[string_count]+strlen(qwerty[string_count])-1,"}")) fig_skob--;				
    		if (!strcmp(qwerty[string_count]+strlen(qwerty[string_count])-1,"{") && !strcmp(str,"if")) { fig_skob_if++; adres_return[fig_skob_if]=number_for_output+3; }
    		if (!strcmp(qwerty[string_count]+strlen(qwerty[string_count])-1,"}") && fig_skob_if>0) { Output[adres_return[fig_skob_if]]=number_for_output; fig_skob_if--;}
    		if (fig_skob==0)
    		{
    			Output[number_for_output++]=0;
    			Output[number_for_output++]=0;
    		}
    
    		if (!strcmp(qwerty[string_count]+strlen(qwerty[string_count])-1,":")) 
    		{ 
    			label[number_label].name=qwerty[string_count];
    			label[number_label++].adress = number_for_output;
    			continue;
    		}				
    //-------------------------------------------------------------------------------------------
    if (!strcmp(str,"r")) if (action_register(qwerty[string_count]) == 1) {printf("ERROR in string: %d", string_count); return 1;} else continue;
    		if (!strcmp(str,"move")) if (move(qwerty[string_count]) == 1) {printf("ERROR in string: %d", string_count); return 1;} else continue;
    		if (!strcmp(str,"speed")) if (speed(qwerty[string_count]) == 1) {printf("ERROR in string: %d", string_count); return 1;} else continue;
    		if (!strcmp(str,"if")) if (condition(qwerty[string_count]) == 1) {printf("ERROR in string: %d", string_count); return 1;} else continue;
    		
    //-----------------------------------------------------------------------------------------
    char* obrab_stroki(char* qwerty, int i)
    {
    	int count;
    	char asnwer1[25];
    
    	for (count=0; (qwerty[count+i]<='z' && qwerty[count+i]>='a') || (qwerty[count+i]<='Z' && qwerty[count+i]>='A'); count++)
    	{
    		answer1[count]=qwerty[count+i];
    	}
    	answer1[count]='\0';
    
    	return answer1;
    }//тут как бы нет ошибок =)
    
    //----------------------------------------------------------------------------------------------
    if (qwerty[i]=='-')
    	{
    		if (qwerty[i+1]=='1' && qwerty[i+2]=='0')
    			{
    				Output[number_for_output++]=answer|MOTOR_SPEC_SPEED_DEC;
    				Output[number_for_output++]=0;
    				return 0;
    			}
    		else
    			return 1;
    	}

    Человек писал компилятор. Самые эпичные моменты

    epichniygovnokoder, 31 Января 2015

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