1. Pascal / Говнокод #15627

    +81

    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
    program matr;
    uses
       crt;
    var
        mas:array [1..100] of integer;
        i,n,imin,imax,min,max,razn:integer;
    begin
    clrscr;
    imax:=1;
    imin:=1;
    randomize;
    write('Введите количество элементов: ');
    readln(n);
    for i:=1 to n do
     begin
      mas[i]:=random(10)-5;
      write(mas[i]:4);
      if mas[i]>mas[imax] then
      begin
      imax:=i;
      end
      else
      if (mas[i]<mas[imin]) then
      begin
      imin:=i;
      end;
      end;
    writeln;
    writeln('MAX[',imax,']:=',mas[imax]);
    writeln('MIN[',imin,']:=',mas[imin]);
    razn:=mas[imax]+mas[imin];
    writeln('Сумма MAX и MIN:=',razn);
     end.

    Написано by "ТАМБОВСКИЙ ВОЛК. Профессионал".
    Знатное говнецо нынче пишут "профессионалы".
    http://www.programmersforum.ru/showthread.php?t=98747

    gost, 31 Марта 2014

    Комментарии (37)
  2. Pascal / Говнокод #15626

    +78

    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
    DynArray = [1..2] of real;
    var
    A : ^DinArray;
    n, i : word;
    BEGIN
    write('Укажите размер массива:');
    readln(n);
    GetMem(A,n*6);
    . . .
    {$R-}
    for i:=1 to n do
    A[i]:=random;
    . . . {любые действия с элементами масссива}
    {$R+}
    FreeMem(A,n*6)
    END.

    Просто феерический говнокод на "Pascal".
    http://logi.cc/dinamicheskaya-pamyat-primer-23/

    gost, 31 Марта 2014

    Комментарии (3)
  3. Pascal / Говнокод #15625

    +88

    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
    var 
      s: string := '1 2 4 8 16 32 64 128 256 512';
      sum: integer;
      num,p: integer;
      numstr: string;
    begin
      sum := 0;
      while s.Length>0 do
      begin
        while s[1]=' ' do // Удаление лидирующих пробелов
          Delete(s,1,1);
        p := Pos(' ',s); // Поиск следующего пробела
        if p=0 then      // Если он не найден, то до конца строки находится последнее число
          p := s.Length;
        numstr := Copy(s,1,p);
        Delete(s,1,p);
        num := StrToInt(numstr);
        sum += num;
      end;
      writeln('Сумма чисел строки равна ',sum);
    end.

    "Pascal" не умеет в split?
    http://pascalabc.net/wiki/index.php/Строки_и_символы._Тексты_программ

    gost, 31 Марта 2014

    Комментарии (34)
  4. Java / Говнокод #15624

    +69

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    public void startApp() {
            StringItem si = new StringItem("Some label","Some text");
            try{
                Image img = Image.createImage("/res/path/to/image.gif");
                FORM.append(img);
            }catch (java.io.IOException ioe){
                ioe.printStackTrace();
            }
            FORM.append(si);
            DISPLAY.setCurrent(FORM);
        }

    Wtf?
    http://www.gfs-team.ru/articles/read/107

    gost, 31 Марта 2014

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

    +157

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    if (settings.bgType === 'pattern')
    {
        if (settings.bgPattern.pack === 'bg-dark') return App.Area.color.light;
        else return App.Area.color.dark;
    }
    else
    {
        return App.Area.color.invert;
        console.log('invert');
    }

    смотрю, что в консоли пусто, и думаю, почему не работает?

    Itareo, 31 Марта 2014

    Комментарии (6)
  6. ActionScript / Говнокод #15621

    −131

    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
    protected function ignite(event:FlexEvent):void {
        imgCooser.dataProvider = new ArrayList([new ObjectProxy({w:Math.round(Math.random()*100+55),t:'0 one'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'1 two'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'2 three'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'3 four'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'4 five'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'5 six'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'6 seven'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'7 eight'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'8 nine'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'9 ten'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'10 eleven'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'11 twelve'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'12 one'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'13 two'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'14 three'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'2 three'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'3 four'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'4 five'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'5 six'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'6 seven'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'7 eight'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'8 nine'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'9 ten'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'10 eleven'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'11 twelve'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'12 one'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'13 two'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'14 three'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'1 two'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'2 three'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'3 four'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'4 five'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'5 six'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'6 seven'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'7 eight'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'8 nine'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'9 ten'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'10 eleven'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'11 twelve'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'12 one'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'13 two'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'14 three'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'2 three'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'3 four'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'4 five'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'5 six'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'6 seven'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'7 eight'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'8 nine'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'9 ten'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'10 eleven'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'11 twelve'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'12 one'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'13 two'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'14 three'}),
                   new ObjectProxy({w:Math.round(Math.random()*100+55),t:'15 four'})]);

    От нечего делать сижу и перебираю коммиты в репозитории, вот наткнулся...

    wvxvw, 30 Марта 2014

    Комментарии (1)
  7. PHP / Говнокод #15620

    +155

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    $uu=substr($d_users,-2);
    $ux1=array(2,3,4,22,23,24,32,33,34,42,43,44,52,53,54,62,63,64,72,73,74,82,83,84,92,93,94);
    $ux2=array(1,21,31,41,51,61,71,81,91);
    $ut='Участников';
    if(in_array($uu,$ux1)){ $ut='Участника'; }
    elseif(in_array($uu,$ux2)){ $ut='Участник'; }

    norvele, 30 Марта 2014

    Комментарии (4)
  8. ActionScript / Говнокод #15619

    −136

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    public function TweenMax(target:Object, duration:Number, vars:Object) {
    	super(target, duration, vars);
    	if (TweenLite.version < 11.2) {
    		throw new Error("TweenMax error! Please update your TweenLite class or try deleting your ASO files. TweenMax requires a more recent version. Download updates at http://www.TweenMax.com.");
    	}

    Тут нужно дополнительно подчеркнуть, что оба класса TweenMax и TweenLite распространяются вместе, и случайно получить несоответствующую версию очень тяжело (ее надо самому поменять).
    Но самое интересное в другом: ASO файлы - это артефакт механизма кеширования использовавшегося в AS2. В AS3 механизм кеширования другой, и об этих файлах давным-давно никто не слышал. Тем не менее, сообщение об ошибке по прежнему предлагает пользователям с ними побороться.

    wvxvw, 30 Марта 2014

    Комментарии (1)
  9. PHP / Говнокод #15618

    +141

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    if($ID==265265265)
    $peremen1 = "poo poo!"
    $whatdo = "Eat"
    $peremen2 = "da"
    echo "$whatdo "."$peremen2 " .$peremen1" //Вот это доставляет
    $var = $ID
    $ci = $var + $ID //Хмм... Объясните, ЗАЧЕМ?

    vk.com/im/
    2011г.
    Видимо они планировали регистрацию юзера с айди 265265265

    Getup1NEW, 30 Марта 2014

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

    +147

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    do
    echo $fun
    $fun = $sand + $sand
    $sand = $sand +1
    echo $sand."is not".$var
    $var = $sand + $fun
    $deer = 23
    while($deer==23)
    if($var==445)
    {
     $fun==2
    }

    Из моих наработок для BrowserFucker

    Getup1NEW, 30 Марта 2014

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