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

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

    +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
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    public void onBackPressed() {
    	if (getSupportFragmentManager().getBackStackEntryCount()==0 || getSupportFragmentManager().getBackStackEntryCount()==1) { 
    							finish();
    							android.os.Process.killProcess(android.os.Process.myPid());
    							((MainActivity)instance).onDestroy();
    	}
    }
    
    /* чуть дальше */
    
                JSONObject jsonObjectA = null, jsonObjectB = null;
                try {
                    jsonObjectA = new JSONObject(a.toString());
                    jsonObjectB = new JSONObject(b.toString());
                } catch (JSONException e1) {
                    e1.printStackTrace();
                }
    
                if ((jsonObjectA != null || jsonObjectB != null) || (jsonObjectA != null && jsonObjectB != null)) {
                    try {
                        valA = jsonObjectA.getString("name");
                        valB = jsonObjectB.getString("name");
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                }

    Первый фрагмент кода - это больше специфика Android - при нажатии кнопки назад: закрыть приложение, убить процесс и дернуть метод onDestroy() который в норме должен автоматом вызваться при закрытии приложения но не вызывается из-за того что мы убиваем процесс. Про то что условие if можно оптимизировать я умолчу.

    На if() во втором фрагменте заглючил даже встроенный в intelliJ Idea инструмент рефакторинга...

    TAX, 20 Июня 2014

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

    +74

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    /**
     * Some UI hacks for JRuby Facet
     */
    public class NiiChAVOUtil { 
    }

    Слова лишнии

    vistall, 18 Июня 2014

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

    −165

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

    Прям классика жанра) Запрос в цикле, и условие к виртуальной таблице регистра сведений)

    adc5, 13 Июня 2014

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

    +157

    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
    function add() {	
    	global $MovRow, $Array_html, $Array_desc, $Array_mov, $Opera;
    	if ($MovRow==4) return;
    	if ($Opera) {
    		for ($i=0; $i<5; $i++) {
    			$Array_html[$i]=str_replace("padding-bottom: 3px;", "", $Array_html[$i]);
    		}
    	}
    
    	for ($i=0; $i<5; $i++) {	
    		if ($Array_mov[$i]<=5) {    	
    			if ($MovRow==5&&$Array_mov[$i]==4)
    				$Array_html[$i]=str_replace($Array_desc[$i], $Array_desc[$i]."<br><br>", $Array_html[$i]);
    			else if ($MovRow==5&&$Array_mov[$i]==3)
    				$Array_html[$i]=str_replace($Array_desc[$i], $Array_desc[$i]."<br><br><br>", $Array_html[$i]);
    			
    			else if ($MovRow==6&&$Array_mov[$i]==4) {	
    			 	$Array_html[$i]=str_replace($Array_desc[$i], $Array_desc[$i]."<br><br><br>", $Array_html[$i]);
    			}
    			else if($MovRow==6&&$Array_mov[$i]==5) {
    				if ($Array_desc[$i][strlen($Array_desc[$i])-1]=='>'&&$Array_desc[$i][strlen($Array_desc[$i])-2]=='r') 
    					$Array_html[$i]=str_replace($Array_desc[$i], $Array_desc[$i]."<br>", $Array_html[$i]);		
    				else $Array_html[$i]=str_replace($Array_desc[$i], $Array_desc[$i]."<br><br>", $Array_html[$i]);				
    			}
    			else if($MovRow==7&&$Array_mov[$i]==4)
    				$Array_html[$i]=str_replace($Array_desc[$i], $Array_desc[$i]."<br><br><br><br>", $Array_html[$i]);
    			else if($MovRow==7&&$Array_mov[$i]==5)
    				$Array_html[$i]=str_replace($Array_desc[$i], $Array_desc[$i]."<br><br><br>", $Array_html[$i]);	
    			else if($MovRow==7&&$Array_mov[$i]==6)
    				$Array_html[$i]=str_replace($Array_desc[$i], $Array_desc[$i]."<br><br>", $Array_html[$i]);
    		}
    	}
    }

    наткнулся на этот код, и что-то нехватает мозгов, чтобы понять, что это, для чего это, и где это чудо применяется =((

    govnokoder2, 10 Июня 2014

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

    +134

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    //костыль так как 1бф у нас не как все
                    if (mod.ModulType == null)
                    {
                        if (Inlist[0].Contains("1BF01")) mod.ModulType = "DO";
                    }

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

    HeinzTockler, 03 Июня 2014

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

    +158

    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
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    95. 95
    96. 96
    97. 97
    98. 98
    // weclome to main-menu-hover.js
    function load(){
    	var url = window.location;
    	var m1 = document.getElementById("m1");
    	var m2 = document.getElementById("m2");
    	var m3 = document.getElementById("m3");
    	var m4 = document.getElementById("m4");
    	//var m5 = document.getElementById("m5");
    	var mm1 = document.getElementById("mm1");
    	var mm2 = document.getElementById("mm2");
    	var mm3 = document.getElementById("mm3");
    	var mm4 = document.getElementById("mm4");
    	var mm5 = document.getElementById("mm5");
    	var mm6 = document.getElementById("mm6");
    	var mm7 = document.getElementById("mm7");
    var mm8 = document.getElementById("mm8");
    	if (m1.href == url){
    	m1.style.color = "#ffc12b";
    	//m1.style.background = "url(%absolute_url_path%/wp-content/themes/%pattern%/images/menu-h-bg1.png)no-repeat top center";
    	m1.style.textDecoration = "none";
    	}
    	if (m2.href == url){
    	m2.style.color = "#ffc12b";
    	m2.style.background = "url(%absolute_url_path%/wp-content/themes/%pattern%/images/menu-h-bg1.png)no-repeat center center";
    	m2.style.textDecoration = "none";
    	}
    	if (m3.href == url){
    	m3.style.color = "#ffc12b";
    	m3.style.background = "url(%absolute_url_path%/wp-content/themes/%pattern%/images/menu-h-bg1.png)no-repeat center center";
    	m3.style.textDecoration = "none";
    	}
    	if (m4.href == url){
    	m4.style.color = "#ffc12b";
    	m4.style.background = "url(%absolute_url_path%/wp-content/themes/%pattern%/images/menu-h-bg1.png)no-repeat center center";
    	m4.style.textDecoration = "none";
    	}
    	if (m5.href == url || url.href.indexOf(m5.href)!=-1){
    	m5.style.color = "#ffc12b";
    	m5.style.background = "url(%absolute_url_path%/wp-content/themes/%pattern%/images/menu-h-bg2.png)no-repeat center center";
    	m5.style.textDecoration = "none";
    	}
    	if (url.href.indexOf(mm1.href)!=-1){
    	mm1.style.color = "#741f0c";
    	mm1.style.background = "url(%absolute_url_path%/wp-content/themes/%pattern%/images/bg-min-menu-h.png)no-repeat center center";
    	m3.style.color = "#ffc12b";
    	m3.style.background = "url(%absolute_url_path%/wp-content/themes/%pattern%/images/menu-h-bg1.png)no-repeat center center";
    	m3.style.textDecoration = "none";
    	}
    	if (url.href.indexOf(mm2.href)!=-1){
    	mm2.style.color = "#741f0c";
    	mm2.style.background = "url(%absolute_url_path%/wp-content/themes/%pattern%/images/bg-min-menu-h.png)no-repeat center center";
    	m3.style.color = "#ffc12b";
    	m3.style.background = "url(%absolute_url_path%/wp-content/themes/%pattern%/images/menu-h-bg1.png)no-repeat center center";
    	m3.style.textDecoration = "none";
    	}
    	if (url.href.indexOf(mm3.href)!=-1){
    	mm3.style.color = "#741f0c";
    	mm3.style.background = "url(%absolute_url_path%/wp-content/themes/%pattern%/images/bg-min-menu-h.png)no-repeat center center";
    	m3.style.color = "#ffc12b";
    	m3.style.background = "url(%absolute_url_path%/wp-content/themes/%pattern%/images/menu-h-bg1.png)no-repeat center center";
    	m3.style.textDecoration = "none";
    	}
    	if (url.href.indexOf(mm4.href)!=-1){
    	mm4.style.color = "#741f0c";
    	mm4.style.background = "url(%absolute_url_path%/wp-content/themes/%pattern%/images/bg-min-menu-h.png)no-repeat center center";
    	m3.style.color = "#ffc12b";
    	m3.style.background = "url(%absolute_url_path%/wp-content/themes/%pattern%/images/menu-h-bg1.png)no-repeat center center";
    	m3.style.textDecoration = "none";
    	}
    	if (url.href.indexOf(mm5.href)!=-1){
    	mm5.style.color = "#741f0c";
    	mm5.style.background = "url(%absolute_url_path%/wp-content/themes/%pattern%/images/bg-min-menu-h.png)no-repeat center center";
    	m3.style.color = "#ffc12b";
    	m3.style.background = "url(%absolute_url_path%/wp-content/themes/%pattern%/images/menu-h-bg1.png)no-repeat center center";
    	m3.style.textDecoration = "none";
    	}
    	if (url.href.indexOf(mm6.href)!=-1){
    	mm6.style.color = "#741f0c";
    	mm6.style.background = "url(%absolute_url_path%/wp-content/themes/%pattern%/images/bg-min-menu-h.png)no-repeat center center";
    	m3.style.color = "#ffc12b";
    	m3.style.background = "url(%absolute_url_path%/wp-content/themes/%pattern%/images/menu-h-bg1.png)no-repeat center center";
    	m3.style.textDecoration = "none";
    	}
    	if (url.href.indexOf(mm7.href)!=-1){
    	mm7.style.color = "#741f0c";
    	mm7.style.background = "url(%absolute_url_path%/wp-content/themes/%pattern%/images/bg-min-menu-h.png)no-repeat center center";
    	m3.style.color = "#ffc12b";
    	m3.style.background = "url(%absolute_url_path%/wp-content/themes/%pattern%/images/menu-h-bg1.png)no-repeat center center";
    	m3.style.textDecoration = "none";
    	}
        if (url.href.indexOf(mm8.href)!=-1){
    	mm8.style.color = "#741f0c";
    	mm8.style.background = "url(%absolute_url_path%/wp-content/themes/%pattern%/images/bg-min-menu-h.png)no-repeat center center";
    	m3.style.color = "#ffc12b";
    	m3.style.background = "url(%absolute_url_path%/wp-content/themes/%pattern%/images/menu-h-bg1.png)no-repeat center center";
    	m3.style.textDecoration = "none";
    	}
    }

    Пришел проект на поддержку... Сразу отказался=)
    Естественно вкрапления %_some_text_% от меня.
    Файл назывался main-menu-hover.js

    iHateBidlocod, 30 Мая 2014

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

    +6

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    const int cx = 5;
    int main() {
    	auto lam = [cx]() mutable {cx=40;};
    	return 0;
    }

    Will it compile or not? Why?
    http://ideone.com/gtlXKb

    LispGovno, 30 Мая 2014

    Комментарии (7)
  9. SQL / Говнокод #16070

    −167

    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
    insert into #rez
     select  ('<html>')
      Union all
     select  ('<head>')
      Union all
     select  ('<meta http-equiv="content-type" content="text/html; charset=Windows-1251">')
      Union all
     select  ('<title> Report </title>')
      Union all
     select  ('<style type="text/css">')
      Union all
     select  ('.{font-family:Arial;font-size:7pt;}')
      Union all
     select  ('#top{border-top-style:solid;border-width:1;}')
      Union all
     select  ('.titl{font-size:15px;}')
      Union all
     select  ('.title{background-color:rgb(240,240,240)}')
      Union all
     select  ('.data{background-color:rgb(248,248,248)}')
      Union all
     select  ('.nam{background-color:rgb(245,245,245)}')
      Union all
     select  ('</style>')
      union all
     select  ('</head>')
      union all
     select  ('<body>')
     UNION ALL
     select  '<P align=left><SPAN style="FONT-SIZE: 12pt">' + @var1 + '<br><br>'
      union all
    -- ... и еще килобайт 50 подобной фигни. местами с генерацией табличек, с помощью if/case подсвеченных ячеек.

    Спорите FastCGI vs WSGI? Говорите "Логика отдельно, шаблончики отдельно", ORM? Ну-ну. добро пожаловать в Махровый ентепрайз.

    bliznezz, 28 Мая 2014

    Комментарии (7)
  10. SQL / Говнокод #16052

    −114

    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
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    select 
    
    row_number() over (order by count(*) desc) r, 
    
    case when t719.f7171 is null and t719.f7201 is null then 'За поданням
    голови ОВК, капітана судна, керівн. полярної станції України' 
    
                when t719.f7171 is not null  then t717.name1 
    
                when t719.f7201 is not null  then t720.f7202||'
    '||t720.f7203||' '||t720.f7204
    
           end t021f02, 
    
            count(*) count1
    
    from  t719,
    
          t066,
    
          t714,
    
          v1_t717 t717,
    
          t720
    
    where t719.t001f01=PT001F01 and
    
          t719.t001f01=t066.t001f01 and
    
          t719.f7331=t066.f7331 and
    
          t719.f7141=t066.f7141 and
    
          t719.f7191=t066.f7191 and
    
          t066.T066F02 is not null and
    
          t066.T066F03 is null and
    
          t719.t001f01=t714.t001f01 and
    
          t719.f7331=t714.f7331 and
    
          t719.f7141=t714.f7141 and
    
          t714.f71480 is null and
    
          t719.f7171=t717.f7171(+) and
    
          t719.t001f01=t717.t001f01(+) and
    
          t719.f7201=t720.f7201(+) and
    
          t719.t001f01=t720.t001f01(+)
    
    group by case when t719.f7171 is null and t719.f7201 is null then 'За
    поданням голови ОВК, капітана судна, керівн. полярної станції України' 
    
                  when t719.f7171 is not null  then t717.name1 
    
                  when t719.f7201 is not null  then t720.f7202||'
    '||t720.f7203||' '||t720.f7204
    
             end
    
    order by count(*) desc, 1;

    Оттуда же.

    Ну и как такое можно сапортить?

    DBdev, 24 Мая 2014

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

    +123

    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
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    namespace Рунге_Кутты_1._4
    {
        public partial class Form1 : Form
        {
            double x0 = 1, y0 = 2, z0 = 4, t0 = 0, T = 1, h = 0.001, Eps = 0.000001, fx, fy, fz, xx, yy, zz, Ex, Ey, Ez, Eps1;
            double[] x = new double[4]; double[] y = new double[4]; double[] z = new double[4];
            double[] Kx = new double[4]; double[] Ky = new double[4]; double[] Kz = new double[4];
            bool a;
            public void Calculates()
            {
                System.IO.File.Delete(@"C:\Results\results.dat");
                x[0] = x0; y[0] = y0; z[0] = z0;
                while (t0 <= T)
                {
                    for (int i = 0; i <= 3; i++)
                    {
                        fx = -y[i] - z[i];
                        fy = x[i] + 0.2 * y[i];
                        fz = 0.2 + (x[i] - 5.7) * z[i];
                        Kx[i] = h * fx;
                        Ky[i] = h * fy;
                        Kz[i] = h * fz;
                        x[1] = x[0] + 0.5 * Kx[0];
                        x[2] = x[0] + 0.5 * Kx[1];
                        x[3] = x[0] + Kx[2];
                        y[1] = y[0] + 0.5 * Ky[0];
                        y[2] = y[0] + 0.5 * Ky[1];
                        y[3] = y[0] + Ky[2];
                        z[1] = z[0] + 0.5 * Kz[0];
                        z[2] = z[0] + 0.5 * Kz[1];
                        z[3] = z[0] + Kz[2];
                    }
                    Ex = Math.Abs(2 * (Kx[0] - Kx[1] - Kx[2] + Kx[3]) / 3);
                    Ey = Math.Abs(2 * (Ky[0] - Ky[1] - Ky[2] + Ky[3]) / 3);
                    Ez = Math.Abs(2 * (Kz[0] - Kz[1] - Kz[2] + Kz[3]) / 3);
                    Eps1 = Eps / 8;
                    a = Check();
                    if (a == false)
                    {
                        xx = x[0] + (Kx[0] + 2 * Kx[1] + 2 * Kx[2] + Kx[3]) / 6;
                        yy = y[0] + (Ky[0] + 2 * Ky[1] + 2 * Ky[2] + Ky[3]) / 6;
                        zz = z[0] + (Kz[0] + 2 * Kz[1] + 2 * Kz[2] + Kz[3]) / 6;
                        x[0] = xx;
                        y[0] = yy;
                        z[0] = zz;
                        t0 += h;
                        string f1 = Convert.ToString(xx);
                        string f2 = Convert.ToString(yy);
                        string f3 = Convert.ToString(zz);
                        string[] f = new string[] { f1, f2, f3 };
                        string path = @"C:\Results\results.dat";
                        string appendtext = xx + " " + yy + " " + zz + Environment.NewLine;
                        System.IO.File.AppendAllText(path, appendtext);
                    }
                }
            }
            public bool Check()
            {
                bool a;
                if (Ex > Eps | Ey > Eps | Ez > Eps)
                {
                    a = true;
                    h /= 2;
                    Calculates();
                }
                else a = false;
                return a;
            }
            public Form1()
            {
                InitializeComponent();
                Calculates();
                DrawGraph();
            }
            public void DrawGraph()
            {
                    GraphPane pane = zedGraph.GraphPane;
                    pane.CurveList.Clear();
                    PointPairList list = new PointPairList();
                    for (t0 = 0; t0 <= T; t0 += h)
                    {
                        list.Add(t0, x[0]);
                    }
                    LineItem MyCurve = pane.AddCurve("x(t)", list, Color.Blue, SymbolType.None);
                    zedGraph.AxisChange();
                    zedGraph.Invalidate();
            }
        }
    }

    пытаюсь вывести решения в виде графика. выводится только последнее решение из цикла

    mr07th, 16 Мая 2014

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