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

    Всего: 3

  2. Java / Говнокод #12129

    +141

    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
    public static Object[] createArray(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14, Object arg15, Object arg16, Object arg17, Object arg18, Object arg19, Object arg20, Object arg21, Object arg22, Object arg23, Object arg24, Object arg25, Object arg26, Object arg27, Object arg28, Object arg29, Object arg30) {
            return new Object[]{
                    arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20, arg21, arg22, arg23, arg24, arg25, arg26, arg27, arg28, arg29, arg30};
        }
    
        public static Object[] createArray(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14, Object arg15, Object arg16, Object arg17, Object arg18, Object arg19, Object arg20, Object arg21, Object arg22, Object arg23, Object arg24, Object arg25, Object arg26, Object arg27, Object arg28, Object arg29, Object arg30, Object arg31) {
            return new Object[]{
                    arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20, arg21, arg22, arg23, arg24, arg25, arg26, arg27, arg28, arg29, arg30, arg31};
        }
    
        public static Object[] createArray(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14, Object arg15, Object arg16, Object arg17, Object arg18, Object arg19, Object arg20, Object arg21, Object arg22, Object arg23, Object arg24, Object arg25, Object arg26, Object arg27, Object arg28, Object arg29, Object arg30, Object arg31, Object arg32) {
            return new Object[]{
                    arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20, arg21, arg22, arg23, arg24, arg25, arg26, arg27, arg28, arg29, arg30, arg31, arg32};
        }
    
        public static Object[] createArray(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14, Object arg15, Object arg16, Object arg17, Object arg18, Object arg19, Object arg20, Object arg21, Object arg22, Object arg23, Object arg24, Object arg25, Object arg26, Object arg27, Object arg28, Object arg29, Object arg30, Object arg31, Object arg32, Object arg33) {
            return new Object[]{
                    arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20, arg21, arg22, arg23, arg24, arg25, arg26, arg27, arg28, arg29, arg30, arg31, arg32, arg33};
        }
    
        public static Object[] createArray(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14, Object arg15, Object arg16, Object arg17, Object arg18, Object arg19, Object arg20, Object arg21, Object arg22, Object arg23, Object arg24, Object arg25, Object arg26, Object arg27, Object arg28, Object arg29, Object arg30, Object arg31, Object arg32, Object arg33, Object arg34) {
            return new Object[]{
                    arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20, arg21, arg22, arg23, arg24, arg25, arg26, arg27, arg28, arg29, arg30, arg31, arg32, arg33, arg34};
        }

    Отменный говнокод http://svn.codehaus.org/groovy/trunk/groovy/groovy-core/src/main/org/codehaus/groovy/runtime/ArrayUtil.java

    betastat, 15 Ноября 2012

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

    +142

    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
    if (!menu) error(E_NOMEM);    /* add titles and items */
      if ((mn_addtitle(menu, "file",     0, 0,           0) != 0)
      ||  (mn_additem (menu, "load",     1, mcb_load,    0) != 0)
      ||  (mn_additem (menu, "save",     0, mcb_save,    0) != 0)
      ||  (mn_additem (menu, "mpost",    0, mcb_mpost,   0) != 0)
      ||  (mn_additem (menu, NULL,       0, 0,           0) != 0)
      ||  (mn_additem (menu, "quit",     0, mcb_quit,    0) != 0)
      ||  (mn_addtitle(menu, "actions",  0, 0,           0) != 0)
      ||  (mn_additem (menu, "init",     0, mcb_init,    0) != 0)
      ||  (mn_additem (menu, "start",    2, mcb_start,   0) != 0)
      ||  (mn_additem (menu, "stop",     4, mcb_start,   0) != 0)
      ||  (mn_additem (menu, NULL,       0, 0,           0) != 0)
      ||  (mn_additem (menu, "view",     0, mcb_view,    0) != 0)
      ||  (mn_additem (menu, "redraw",   0, mcb_redraw,  0) != 0)
      ||  (mn_addtitle(menu, "settings", 0, 0,           0) != 0)
      ||  (mn_additem (menu, "grid",     1, mcb_grid,    0) != 0)
      ||  (mn_additem (menu, "params",   0, mcb_params,  0) != 0)
      ||  (mn_addtitle(menu, "help",     0, 0,           0) != 0)
      ||  (mn_additem (menu, "about",    0, mcb_about,   0) != 0)
      ||  (mn_addtitle(menu, NULL,       0, 0,           0) != 0))
        error(E_WIDGET);
      mn_resize (menu, INITXEXT);   /* set width of menu bar */
      mn_visible(menu, MN_ITEMS, 3);/* show/hide      menu items */
      mn_enable (menu, MN_ITEMS, 3);/* enable/disable menu items */

    Кусок кода из программы http://www.borgelt.net/doc/somd/somd.html для визуализации SOM. Эпичная проверка условий!

    betastat, 04 Июня 2012

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

    +75

    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
    int i128 = 0, i256 =0, i384=0, i512=0, i640=0, i786=0, i896=0, i1024=0, i1152=0, i1280=0, i1408=0, i1536=0;
            for (int index: data) {
                if (index>max) max = index;
                if (min>index) min = index;
                if (0<=index & index<128) i128++;
                else if (128<=index & index<256) i256++;
                else if (256<=index & index<384) i384++;
                else if (384<=index & index<512) i512++;
                else if (512<=index & index<640) i640++;
                else if (640<=index & index<786) i786++;
                else if (786<=index & index<896) i896++;
                else if (896<=index & index<1024) i1024++;
                else if (1024<=index & index<1152) i1152++;
                else if (1152<=index & index<1280) i1280++;
                else if (1280<=index & index<1408) i1408++;
                else if (1408<=index & index<1536) i1536++;

    Считаем количество попаданий index в различные диапазоны значений.

    betastat, 01 Ноября 2011

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