1. C++ / Говнокод #20073

    +5

    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
    //Collisions
    static float collisionradius;
    if(numplayers>1)
    	for(k=0;k<numplayers;k++){
    	for(i=k;i<numplayers;i++){
    	if(i==k)i++;
       			if(i<numplayers)
       					if((animation[player[i].targetanimation].attack!=reversed&&animation[player[i].targetanimation].attack!=reversal&&animation[player[k].targetanimation].attack!=reversed&&animation[player[k].targetanimation].attack!=reversal)||(i!=0&&k!=0))
       						if((animation[player[i].currentanimation].attack!=reversed&&animation[player[i].currentanimation].attack!=reversal&&animation[player[k].currentanimation].attack!=reversed&&animation[player[k].currentanimation].attack!=reversal)||(i!=0&&k!=0))
       							if(player[i].howactive<=typesleeping&&player[k].howactive<=typesleeping)
       								if(player[i].howactive!=typesittingwall&&player[k].howactive!=typesittingwall)
       									if(i!=k&&player[i].whichpatchx==player[k].whichpatchx&&player[i].whichpatchz==player[k].whichpatchz&&player[k].skeleton.oldfree==player[k].skeleton.free&&player[i].skeleton.oldfree==player[i].skeleton.free&&player[i].targetanimation!=climbanim&&player[i].targetanimation!=hanganim&&player[k].targetanimation!=climbanim&&player[k].targetanimation!=hanganim)
       										if(player[i].coords.y>player[k].coords.y-3)
       											if(player[i].coords.y<player[k].coords.y+3)
       												if(player[i].coords.x>player[k].coords.x-3)
       													if(player[i].coords.x<player[k].coords.x+3)
       														if(player[i].coords.z>player[k].coords.z-3)
       															if(player[i].coords.z<player[k].coords.z+3){
       																if(findDistancefast(&player[i].coords,&player[k].coords)<3*((player[i].scale+player[k].scale)*2.5)*((player[i].scale+player[k].scale)*2.5)){
      																	if(player[i].onfire||player[k].onfire){
      																		if(!player[i].onfire)player[i].CatchFire();
       																		if(!player[k].onfire)player[k].CatchFire();
       																	}
       																}
       																...

    http://hg.icculus.org/icculus/lugaru/file/97b303e79826/Source/GameTick.cpp#l7276

    gammaker, 25 Мая 2016

    Комментарии (3)
  2. C++ / Говнокод #20072

    +9

    1. 1
    2. 2
    3. 3
    #define GetLastError rand /* optimize API work */ 
    #define struct union /* saves memory */ 
    #define while if /* saves cpu time */

    dm_fomenok, 25 Мая 2016

    Комментарии (15)
  3. JavaScript / Говнокод #20066

    +4

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    /*не знаю, почему на массиве не сработал concat()*/
    function arrPusher (arr) {
        _.forEach(arr, function (i) {
            saveParams.push(i);
        });
    }

    finico, 24 Мая 2016

    Комментарии (2)
  4. JavaScript / Говнокод #20065

    −1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    handleNewConfigRuleLoaded: function(
        this.handleConfigRuleLoaded0({rule: event.configRule}, true, false);
    },
    
    handleConfigRuleLoaded: function(event) {
        this.handleConfigRuleLoaded0(event.configRule, false, false);
    },

    Старый добрый бэкбон и не знания карринга

    NuclleaR, 24 Мая 2016

    Комментарии (3)
  5. JavaScript / Говнокод #20062

    0

    1. 1
    2. 2
    $.get( '/scripts/ajax/popup/add_to_favorite.php', { id: productID, ajax_call: 'Y' }, function ( data ) {
                        data = JSON.parse( data );

    $.getJSON
    http://www.sapato.ru/js/ajax/widgets/baseAjaxes.js?bust=208

    nik757, 23 Мая 2016

    Комментарии (3)
  6. C# / Говнокод #20060

    +4

    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
    public class tcMoveDirection
    		{
    			public enum tcDirection { R, L, N };
    			static public tcDirection fromstring(string expression)
    			{
    				switch (expression)
    				{
    					case "R":
    						return tcDirection.R;
    
    					case "L":
    						return tcDirection.L;
    
    					case "N":
    						return tcDirection.N;
    
    					default: throw new InvalidCastException();
    				}
    
    			}
    
    		}

    dm_fomenok, 23 Мая 2016

    Комментарии (5)
  7. C# / Говнокод #20058

    +6

    1. 1
    2. 2
    3. 3
    if (selectedGroup == null)
        return null;
    return selectedGroup;

    зачем if то?

    kontora, 23 Мая 2016

    Комментарии (24)
  8. C# / Говнокод #20057

    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
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    
    namespace ConsoleApplication2
    {
      [StandardModule]
      internal sealed class Module1
      {
        [STAThread]
        public static void Main()
        {
    label_0:
          int num1;
          int num2;
          try
          {
            ProjectData.ClearProjectError();
            num1 = 1;
    label_1:
            int num3 = 2;
            Test.TTT();
            goto label_8;
    label_3:
            num2 = num3;
            switch (num1)
            {
              case 1:
                int num4 = num2 + 1;
                num2 = 0;
                switch (num4)
                {
                  case 1:
                    goto label_0;
                  case 2:
                    goto label_1;
                  case 3:
                  case 4:
                    goto label_8;
                }
            }
          }
          catch (Exception ex) when (ex is Exception & (uint) num1 > 0U & num2 == 0)
          {
            ProjectData.SetProjectError(ex);
            goto label_3;
          }
          throw ProjectData.CreateProjectError(-2146828237);
    label_8:
          if (num2 == 0)
            return;
          ProjectData.ClearProjectError();
        }
      }
    }

    Вот какая жуть получилась при декомпиляции старого доброго On Error Resume Next из VB.
    Исходный код:
    Sub Main()
    On Error Resume Next
    TTT() 'определен в модуле Test
    Exit Sub
    End Sub

    yamamoto, 23 Мая 2016

    Комментарии (16)
  9. C++ / Говнокод #20056

    +4

    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
    string TRASETXT::trace(string &a // получаемая строка ) 
    { 
        string b; // возвращаемая строка 
        stringstream s; // строковый поток 
        // переводит в втооом словосочетании все большие буквы в маленькие 
        for (unsigned int i = 0; i < a.size(); i++) // а - получаемая строка 
        { 
            int key = a[i]; 
            if ((key <= -33) && (key >= -64)) // от А до Я 
                key += 32; 
            if (key == -88) // только буква Ё 
                key = -72; 
            if ((key >= 65) && (key <= 90)) // от A до Z 
                key += 32; 
            s << (char)key; 
        } 
        getline(s, b); // получаем строку только из маленьких букв во временную переменную 
        s.clear(); // очищаем поток 
        return b; 
    }

    Увидел в курсаче у чувака, лучший метод преобразования строки в lowercase, везде буду использовать теперь и вам рекомендую

    semoro, 23 Мая 2016

    Комментарии (49)
  10. Куча / Говнокод #20055

    +4

    1. 1
    http://надальнийвосток.рф

    ну не всем же напитон...

    defecate-plusplus, 22 Мая 2016

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