1. Лучший говнокод

    В номинации:
    За время:
  2. Си / Говнокод #28041

    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
    void pong_game(void)
       {
          /*Set the first random direction the ball will be traviling*/
          direction=random_direction();
          
          /*Play the game while the ESC key is not pressed*/
          while(!key[KEY_ESC]) {
             /*Move the Ball*/
             move_ball();
             /*Respond to the input*/
             key_respond();
             
             /*Put the information on the Screen*/
             textout(buffer,pong_datafile[pong_text].dat,"Player 1 Score:",
                     150,0,254);
             textout(buffer,pong_datafile[pong_text].dat,itoa(score_p1,NULL,10),
                     text_length(pong_datafile[pong_text].dat,
                     "Player 1 Score:")+150,0,10);
             textout(buffer,pong_datafile[pong_text].dat,"Player 2 Score:",
                     350,0,254);
             textout(buffer,pong_datafile[pong_text].dat,itoa(score_p2,NULL,10),
                     text_length(pong_datafile[pong_text].dat,
                                 "Player 2 Score:")+350,0,10);
             textout(buffer,pong_datafile[pong_text].dat,"keyboard",0,0,255);
             textout(buffer,pong_datafile[pong_text].dat,"joystick",
                     640-text_length(pong_datafile[pong_text].dat,"joystick"),
                     0,255);
             /*Draw a line to set the boundries*/
             line(buffer,0,30,640,30,10);
             
             /*Put the buffer screen on the screen*/
             blit(buffer,screen,0,0,0,0,640,480);
             
             /*Clear the buffer*/
             clear(buffer);
          }
          return;
       }

    помните?

    kcalbCube, 20 Февраля 2022

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

    −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
    23. 23
    Функция ПолучитьОсновногоБухгалтераПоОрганизации(организация) Экспорт
    
    	текстЗапроса = "
    		|ВЫБРАТЬ ПЕРВЫЕ 1
    		|	ПользовательБухгалтер
    		|ИЗ
    		|	РегистрСведений.СКАНИЯ_ОтветственныеБухгалтерыПоОрганизациям
    		|ГДЕ
    		|	Организация = &организация
    		|	И Основной = ИСТИНА
    		|";
    
    	запрос = Новый Запрос(текстЗапроса);
    	запрос.УстановитьПараметр("организация", организация);
    	
    	выборка = запрос.Выполнить().Выбрать();
    	Если выборка.Следующий() Тогда
    		возврат выборка.ПользовательБухгалтер;
    	Иначе
    		возврат Справочники.Пользователи.ПустаяСсылка();
    	КонецЕсли;
    
    КонецФункции

    alexey85, 31 Января 2022

    Комментарии (6)
  4. Си / Говнокод #27970

    +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
    #include <stdio.h>
    #include <string.h>
    
    int main() 
    {
        char* lalka = "bagor";
        if (0!=strcmp(lalka, "bagor‮ ⁦// comment⁩ ⁦")) {
            puts("Kakoi gabor )))");
        }
        if (0!=strcmp(lalka, "bagor")){
            puts("Pituz!");
        }    
        return 0;
    }

    https://ideone.com/RiM3LX

    #stdout
    Kakoi gabor )))

    3.14159265, 27 Января 2022

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

    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
    using System;
    					
    public class Program
    {
    	public static void Main()
    	{
    		69.Doeb();
    		typeof(Ext).Doeb();
    	}
    }
    
    public static class Ext
    {
    	public static void Doeb(this object o)
    	{
    		string s;
    		Type type = o.GetType();
    		s = type.ToString();
    		while(type != null)
    		{
    			type = type.BaseType;
    			try
    			{
    				s += $" > {type.ToString()}";
    			}
    			catch
    			{
    				break;
    			}
    		}
    		Console.WriteLine(s);
    	}
    }

    Ты с какого района? Чьих будешь?

    SystemGCCollect, 22 Января 2022

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

    +3

    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
    buf = malloc(8 * 1024);
    
    snprintf(buf, 8 * 1024,
         "{\n"
         "\t\"tilejson\": \"2.0.0\",\n"
         "\t\"schema\": \"xyz\",\n"
         "\t\"name\": \"%s\",\n"
         "\t\"description\": \"%s\",\n"
         "\t\"attribution\": \"%s\",\n"
         "\t\"minzoom\": %i,\n"
         "\t\"maxzoom\": %i,\n"
         "\t\"tiles\": [\n",
         tile_config->xmlname, (tile_config->description ? tile_config->description : ""), tile_config->attribution, tile_config->minzoom, tile_config->maxzoom);
    
    for (i = 0; i < tile_config->noHostnames; i++) {
        strncat(buf, "\t\t\"", 8 * 1024 - strlen(buf) - 1);
        strncat(buf, tile_config->hostnames[i], 8 * 1024 - strlen(buf) - 1);
        strncat(buf, tile_config->baseuri, 8 * 1024 - strlen(buf) - 1);
        strncat(buf, "{z}/{x}/{y}.", 8 * 1024 - strlen(buf) - 1);
        strncat(buf, tile_config->fileExtension, 8 * 1024 - strlen(buf) - 1);
        strncat(buf, "\"", 8 * 1024 - strlen(buf) - 1);
    
        if (i < tile_config->noHostnames - 1) {
            strncat(buf, ",", 8 * 1024 - strlen(buf) - 1);
        }
    
        strncat(buf, "\n", 8 * 1024 - strlen(buf) - 1);
    }
    
    strncat(buf, "\t]\n}\n", 8 * 1024 - strlen(buf) - 1);
    len = strlen(buf);
    
    /*
     * Add HTTP headers. Make this file cachable for 1 week
     */
    md5 = ap_md5_binary(r->pool, (unsigned char *)buf, len);
    apr_table_setn(r->headers_out, "ETag",
               apr_psprintf(r->pool, "\"%s\"", md5));
    ap_set_content_type(r, "application/json");
    ap_set_content_length(r, len);
    apr_table_mergen(t, "Cache-Control",
             apr_psprintf(r->pool, "max-age=%" APR_TIME_T_FMT,
                      maxAge));
    timestr = apr_palloc(r->pool, APR_RFC822_DATE_LEN);
    apr_rfc822_date(timestr, (apr_time_from_sec(maxAge) + r->request_time));
    apr_table_setn(t, "Expires", timestr);
    ap_rwrite(buf, len, r);
    free(buf);

    https://github.com/openstreetmap/mod_tile/blob/master/src/mod_tile.c#L1212

    ISO, 10 Января 2022

    Комментарии (6)
  7. JavaScript / Говнокод #27899

    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
    type Tree<T> = T;
    
    function main() {
    
        let a: Tree<TypeOf<1>>;
    
        a = 10;
    
        print(a);
    
        print("done.");
    }

    новый виток развития TypeScript компайлера.

    ASD_77, 28 Декабря 2021

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

    +2

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    Ltac2 make_match fields :=
      destruct x;
      iter (fun a => focus 1 1 (fun () =>
                               let a := a ()
                               in refine (fun () => '((w_rep $a) _)))
             ) fields.

    Итерация по конструкторам индуктивного типа данных.

    CHayT, 03 Декабря 2021

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

    +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
    #include <iostream>
    #include <cstdio>
     
    namespace std {
        namespace ios_base2 {
    	    extern struct sync_with_stdio_t {
    	    	void h(bool sync = true) {
    		    	ios_base::sync_with_stdio(sync);
    		    }
    	    } sync_with_stdio;
        }
    }
     
    int main() {
    	std::ios_base2::sync_with_stdio.h(false);
    	std::cout << "1";
    	printf("2");
    	std::cout << "3";
    	puts("");
    	return 0;
    }

    132

    https://ideone.com/NkGYUL

    3_dar, 25 Ноября 2021

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

    0

    1. 1
    Давайте флудить и троллить ;-)

    Давайте флудить и троллить ;-)

    bot_batbot_batbot, 27 Октября 2021

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

    +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
    public class RegLocalityPK
      implements Serializable
    {
      private String countryNo;
      private String govNo;
      private String localityNo;
      
      public String getGovNo()
      {
        return this.govNo;
      }
      …

    IIIyqpymuHckuu_nemyx, 03 Сентября 2021

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