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

    +121

    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
    procedure TForm1.Timer2Timer(Sender: TObject);
    begin
    image75.Visible:=false;image76.Visible:=false;
    image1.Visible:=true;image2.Visible:=true;image3.Visible:=true;
    image4.Visible:=true;image5.Visible:=true;image6.Visible:=true;
    image7.Visible:=true;image8.Visible:=true;image9.Visible:=true;
    image10.Visible:=true;image11.Visible:=true;image12.Visible:=true;
    image13.Visible:=true;image14.Visible:=true;image15.Visible:=true;
    image16.Visible:=true;image17.Visible:=true;image18.Visible:=true;
    image19.Visible:=true;image20.Visible:=true;image21.Visible:=true;
    image22.Visible:=true;image23.Visible:=true;image24.Visible:=true;
    image25.Visible:=true;image26.Visible:=true;image27.Visible:=true;
    image28.Visible:=true;image29.Visible:=true;image30.Visible:=true;
    image31.Visible:=true;image32.Visible:=true;image33.Visible:=true;
    image34.Visible:=true;image35.Visible:=true;image36.Visible:=true;
    image37.Visible:=true;image38.Visible:=true;image39.Visible:=true;
    image40.Visible:=true;image41.Visible:=true;image42.Visible:=true;
    image43.Visible:=true;image44.Visible:=true;image45.Visible:=true;
    image46.Visible:=true;image47.Visible:=true;image48.Visible:=true;
    image49.Visible:=true;image50.Visible:=true;image51.Visible:=true;
    image52.Visible:=true;image53.Visible:=true;image54.Visible:=true;
    image55.Visible:=true;image56.Visible:=true;image57.Visible:=true;
    image58.Visible:=true;image59.Visible:=true;image60.Visible:=true;
    image61.Visible:=true;image62.Visible:=true;image63.Visible:=true;
    image64.Visible:=true;image65.Visible:=true;image66.Visible:=true;
    image67.Visible:=true;image68.Visible:=true;image69.Visible:=true;
    image70.Visible:=true;image71.Visible:=true;image72.Visible:=true;
    image73.Visible:=true;
    if image1.left<360 then begin timer2.Enabled:=false;button2.Visible:=true;
    image1.Visible:=false;image2.Visible:=false;image3.Visible:=false;
    image4.Visible:=false;image5.Visible:=false;image6.Visible:=false;
    image7.Visible:=false;image8.Visible:=false;image9.Visible:=false;
    image10.Visible:=false;image11.Visible:=false;image12.Visible:=false;
    image13.Visible:=false;image14.Visible:=false;image15.Visible:=false;
    image16.Visible:=false;image17.Visible:=false;image18.Visible:=false;
    image19.Visible:=false;image20.Visible:=false;image21.Visible:=false;
    image22.Visible:=false;image23.Visible:=false;image24.Visible:=false;
    image25.Visible:=false;image26.Visible:=false;image27.Visible:=false;
    image28.Visible:=false;image29.Visible:=false;image30.Visible:=false;
    image31.Visible:=false;image32.Visible:=false;image33.Visible:=false;
    image34.Visible:=false;image35.Visible:=false;image36.Visible:=false;
    image37.Visible:=false;image38.Visible:=false;image39.Visible:=false;
    image40.Visible:=false;image41.Visible:=false;image42.Visible:=false;
    image43.Visible:=false;image44.Visible:=false;image45.Visible:=false;
    image46.Visible:=false;image47.Visible:=false;image48.Visible:=false;
    image49.Visible:=false;image50.Visible:=false;image51.Visible:=false;
    image52.Visible:=false;image53.Visible:=false;image54.Visible:=false;
    image55.Visible:=false;image56.Visible:=false;image57.Visible:=false;
    image58.Visible:=false;image59.Visible:=false;image60.Visible:=false;
    image61.Visible:=false;image62.Visible:=false;image63.Visible:=false;
    image64.Visible:=false;image65.Visible:=false;image66.Visible:=false;
    image67.Visible:=false;image68.Visible:=false;image69.Visible:=false;
    image70.Visible:=false;image71.Visible:=false;image72.Visible:=false;
    image73.Visible:=false;end
    else begin image1.left:=image1.Left-3;image1.top:=image1.top-1;
    image2.left:=image2.Left+2;image2.top:=image2.top+2;
    image3.left:=image3.Left-1;image3.top:=image3.top-3;
    image4.left:=image4.Left-2;image4.top:=image4.top+4;
    ...

    Ещё 65 строк кода!
    Анимация взрыва на Delphi 7.

    artar94, 24 Апреля 2012

    Комментарии (36)
  2. PHP / Говнокод #10029

    +102

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    $compareCost = 0;
    $countGacha = 0;
    for($i=0; $i<10; ++$i): 
        $compareCost += $this->freeGacha->getCost();
        if( $this->player->getSocialPoint() > $compareCost )        continue;
        else break;
        $countGacha = $i+1;
    endfor;

    Korean style ;)

    nidkor, 24 Апреля 2012

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

    +96

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    public void setWeather(WeatherData[] weather) {
    		weatherInfo.setWeather(weather[0]);
    		weatherInfo.setTomorrowWeather(weather[1]);
    		weatherInfo.setDayAfterTomorrowWeather(weather[2]);
    		weatherInfo.setDayAfterDayAfterTomorrowWeather(weather[3]);
    		weatherInfo.setDayAfterDayAfterDayAfterTomorrowWeather(weather[4]);
    		weatherInfo.setDayAfterDayAfterDayAfterDayAfterTomorrowWeather(weather[5]);
    	}

    Студенты такие студенты....

    b3er, 23 Апреля 2012

    Комментарии (14)
  4. PHP / Говнокод #10025

    +100

    1. 1
    2. 2
    3. 3
    if ($node->title == 'Главная страница' || $node->title == 'Home')
    {print '<img src="sites/all/themes/them/images/stock.png" />';
    }

    Говнокод по Drupal-овски.
    Найден в шаблоне page.tpl.php

    Dishvola, 23 Апреля 2012

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

    −89

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    MdlСимметричность.Командная(СтИстБи, ФлагСим, КвоРабЧис)
                If ФлагСим = True Then ' тут мы сохраним столб истинности линейной функции и количество рабочих чисел
                    ФлагСим1 = True 'покажем, что хоть одна функция симметрична
                    СохранимНужнуюФункцию(СчетСим, КвоРабЧисЖмин, КвоРабЧис, СтИстБи, СтИстБиИскомыйСим)
                End If

    Как, пример, как нельзя называть и обзывать переменные и имена функций. Взято отсюда: http://www.sql.ru/forum/actualthread.aspx?tid=934300

    Ciana, 23 Апреля 2012

    Комментарии (12)
  6. PHP / Говнокод #10023

    +96

    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
    // expressions to parse
    		$input_pars = array(
    			's:2'=>'(sort(\d+)/?)?', 				//1-2
    			'id:2'=>'((\d+)/?)?',  			 		//3-4
    			'utkonos_id-shop_id:2-2'=>'(u(\d+)(s(\d+))?/)?', 	//5-6 7-8
    			'iid:1'=>'([0-9a-zA-Z_]+)/?', 				//9
    			'page:2'=>'(pg(\d+)/)?', 				//10-11
    			'chpsize:2'=>'(chp(\d+)/)?', 				//12-13
    			'chlist:2'=>'(chlist_(grid|list)/)?', 				//14-15
    			'p_other:1'=>'(.*)',					//16
    		);
    		if(!$class)unset($input_pars['iid:1']);
    		$m = array();
    		$i=0;
    
    		if(isset($_REQUEST['p_'])&&preg_match('[^'.implode('',$input_pars).'$]',$_REQUEST['p_'],$m)) {
    			//vd($m);
    			foreach($input_pars as $key=>$line) {
    				list($par_name,$num) = explode(':', $key);
    				$par_name_arr = explode('-',$par_name);
    				$num_arr = explode('-',$num);
    				if(count($par_name_arr)>1) {
    					foreach($par_name_arr as $kluch => $par_name) {
    						$i += $num_arr[$kluch];
    						$_REQUEST[$par_name] = $m[$i];
    					}
    				}else{
    					$i += $num;
    					$_REQUEST[$par_name] = $m[$i];
    				}
    			}
    			$_REQUEST['id'] += 0;
    			if ($_REQUEST['s'] === '0') {
    				$_REQUEST['s'] = 0;
    			}
    			if ($_REQUEST['chpsize'] === '0') {
    				$_REQUEST['chpsize'] = 0;
    			}
    			vd($_REQUEST);
    		}else{
    			$_REQUEST['s'] = grv('s',-1);						/// Сортировка
    			$_REQUEST['id'] = grv('id',0);
    			$_REQUEST['shop_id'] = grv('shop_id',0);
    			$_REQUEST['page'] = grv('page',0);
    			$_REQUEST['chpsize'] = (int)grv('chpsize',-1);
    		}

    ggg, 23 Апреля 2012

    Комментарии (2)
  7. Куча / Говнокод #10022

    +103

    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
    digits n  = reverse $ map (`mod` 10) (takeWhile (/= 0) (iterate (`div` 10) n))
    
    fromDigits l = sum $ zipWith (*) (reverse l) (map (10^) [0..])
    
    isPalindromic x = digits x == (reverse $ digits x)
    
    
    f :: Integer -> [[Integer]] -> [Integer] -> Int -> [[Integer]]
    f x founded lookedup niter 
                      | niter > 50 = [notlychers, [x] ++ lychers ++ lookedup, zs]
                      | nextX `elem` notlychers = [[x] ++ notlychers ++ lookedup, lychers, zs]
                      | nextX `elem` lychers = [notlychers, [x] ++ lychers ++ lookedup, zs]
                      | isPalindromic nextX = [[x] ++ notlychers ++ lookedup, lychers, zs]
                      | otherwise = f nextX founded (x : lookedup) (niter+1)
       where nextX = x + fromDigits (reverse $ digits x)
             notlychers = founded !! 0
             lychers = founded !! 1
             zs = founded !! 2
    
    g :: [[Integer]] -> [[Integer]]
    g founded = f (x-1) [xs, ys, [x-1]] [] 0
     where x  = zs !! 0
           xs = founded !! 0
           ys = founded !! 1
           zs = founded !! 2
    
    gg n = g [[],[],[n+1]]
    
    isLycher n = null $ (gg n) !! 0

    http://projecteuler.net/problem=55
    http://projecteuler.net/thread=55


    >i even haven't understood why it works :(

    TheHamstertamer, 23 Апреля 2012

    Комментарии (48)
  8. PHP / Говнокод #10021

    +95

    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
    <table style="width: 100%">
    				<tr>
    					<td rowspan="2" style="width: 39px">&nbsp;</td>
    					<td height="22px" width="306px" background="/templates/images/all_for_your.jpg" style="background-repeat: no-repeat;"></td>
    					<td>&nbsp;</td>
    				</tr>
    				<tr>
    					<td width="306px">
    						<table  class="style2" style="height: 147px;" >
    <tr>
    					<!--<td height="22px" width="306px" background="/templates/images/all_for_your.jpg">
    				</td>-->
    				</tr>
    				<tr>
    					<td class="style14" style="height: 21px;"><a href="page13.html" <?php if ($_GET['id'] == 13) echo "style=\"color: red;\""; ?>> ччччч</td>
    				</tr>
    								<tr>
    					<td class="style14" style="height: 21px;"><a href="page12.html" <?php if ($_GET['id'] == 12) echo "style=\"color: red;\""; ?>> фвургия</td>
    				</tr>
    								<tr> 
    					<td class="style14" style="height: 21px; ">
    					<a href="page8.html" <?php if ($_GET['id'] == 8) echo "style=\"color: red;\""; ?>> ывфыв</a> </td>
    			    </tr>
    				<tr>
    					<td class="style14" style="height: 21px; ;"><a href="page9.html" <?php if ($_GET['id'] == 9) echo "style=\"color: red;\""; ?>> ыывсия</td>
    				</tr>
    				<tr>
    					<td class="style14" style="height: 21px; "><a href="page43.html" <?php if ($_GET['id'] == 43) echo "style=\"color: red;\""; ?>> Вмиика</td>
    				</tr>				
    				<tr>
    					<td class="style14" style="height: 21px; "><a href="page10.html" <?php if ($_GET['id'] == 10) echo "style=\"color: red;\""; ?>>ние</td>
    				</tr>
    					<tr>
    					<td class="style14" style="height: 21px; "><a href="page14.html" <?php if ($_GET['id'] == 14) echo "style=\"color: red;\""; ?>>Одыа 
    					</td>
    				</tr>
    					<tr>
    					<td class="style14" style="height: 21px; "><a href="page22.html" <?php if ($_GET['id'] == 22) echo "style=\"color: red;\""; ?>> Оысия</td>
    				</tr>
    			</table>

    Один из старых сайтов нашел:)

    EGR, 23 Апреля 2012

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

    +112

    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
    <?php
    @session_start();
    include("с.php");
    if(isset($_POST['postid'])){
    	if($_POST['PoM']=="plus"){
    		if(isset($_SESSION['userid']) && mysql_num_rows(mysql_query("SELECT * FROM `bans` WHERE `userid`='".@$_SESSION['userid']."';"))==0){
    		$query89=mysql_query("SELECT `from` FROM `blogs` WHERE `bid`='".$_POST['postid']."' LIMIT 1;");
    		if($_SESSION['userid']==mysql_result($query89, 0, 0)){ } else {
    		$get_rating=mysql_query("SELECT `rating` FROM `blogs` WHERE `bid`='".$_POST['postid']."';");
    		$check_vote_plus=mysql_query("SELECT `voteid` FROM `blogvotes` WHERE `bid`='".$_POST['postid']."' and `userid`='".$_SESSION['userid']."' and `PoM`='plus';");
    		$check_vote_minus=mysql_query("SELECT `voteid` FROM `blogvotes` WHERE `bid`='".$_POST['postid']."' and `userid`='".$_SESSION['userid']."' and `PoM`='minus';");
    		if(mysql_num_rows(@$check_vote_minus)){
    		mysql_query("DELETE FROM `blogvotes` WHERE `bid`='".$_POST['postid']."' and `userid`='".$_SESSION['userid']."';");
    		mysql_query("UPDATE `blogs` SET `rating`=".mysql_result($get_rating, 0, 0)."+1 WHERE `bid`='".$_POST['postid']."';");
    		}
    		$get_rating2=mysql_query("SELECT `rating` FROM `blogs` WHERE `bid`='".$_POST['postid']."';");
    		$check_vote_plus3=mysql_query("SELECT `voteid` FROM `blogvotes` WHERE `bid`='".$_POST['postid']."' and `userid`='".$_SESSION['userid']."' and `PoM`='plus';");
    		if(!mysql_num_rows(@$check_vote_plus3)){
    		mysql_query("UPDATE `blogs` SET `rating`=".mysql_result($get_rating2, 0, 0)."+1 WHERE `bid`='".$_POST['postid']."';");
    		mysql_query("INSERT INTO blogvotes(`bid`, `userid`, `PoM`) VALUES('".$_POST['postid']."', '".$_SESSION['userid']."', '".$_POST['PoM']."');");
    		$query6=mysql_query("SELECT `userid`, `username`, `email`, `points`, `reputation` FROM `users` WHERE `userid`='".$_SESSION['userid']."' LIMIT 1");
    		$current_user=mysql_fetch_row($query6);
    		}
    		}
    		}
    		$get_r_rating=mysql_query("SELECT `rating` FROM `blogs` WHERE `bid`='".$_POST['postid']."';");
    		$ratingValue=mysql_result($get_r_rating, 0, 0);
    	}
    }
    ?>

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

    BiggestFox, 23 Апреля 2012

    Комментарии (8)
  10. Java / Говнокод #10019

    +70

    1. 1
    if (sAttrName.equalsIgnoreCase("10")) {

    someone, 23 Апреля 2012

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