1. PHP / Говнокод #20280

    −2

    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
    99. 99
    <div class='min_content'>
    <?php
    $query_search = '`janr` LIKE "%'.$tip.'%" AND `xarakter_filma` LIKE "%'.$xar.'%" AND `detail_janr` LIKE "%'.$det.'%"';
      $num = 12;
    // Извлекаем из URL текущую страницу
        $page = (int)$_GET['page'];               
    // Определяем общее число сообщений в базе данных
    $count = "SELECT COUNT(*) FROM kino WHERE $query_search";
    $ardyunq = $db->query($count);
    $temp = $ardyunq->fetch(PDO::FETCH_NUM);;
    If ($temp[0] > 0)
    {  
    $tempcount = $temp[0];
    // Находим общее число страниц
    $total = (($tempcount - 1) / $num) + 1;
    $total =  intval($total);
    // Определяем начало сообщений для текущей страницы
    $page = intval($page);
    // Если значение $page меньше единицы или отрицательно
    // переходим на первую страницу
    // А если слишком большое, то переходим на последнюю
    if(empty($page) or $page < 0) $page = 1;
      if($page > $total) $page = $total;  
    // Вычисляем начиная с какого номера
    // следует выводить сообщения
    $start = $page * $num - $num;
    // Выбираем $num сообщений начиная с номера $start
    $qury_start_num = " LIMIT $start, $num"; 
    }  
        $query_search = '`janr` LIKE "%'.$tip.'%" AND `xarakter_filma` LIKE "%'.$xar.'%" AND `detail_janr` LIKE "%'.$det.'%"';
    $sql = "SELECT * FROM kino WHERE $query_search ORDER BY god DESC $qury_start_num";
    $result = $db->query($sql); 
    $rows = $result->fetch(PDO::FETCH_ASSOC);
    if(count($rows) > 0){
    while($row = $result->fetch(PDO::FETCH_ASSOC)) {
         echo "
    <div class='kino'>
    <div class='tkt'>
      <h2 class='namm'><a class='linka' href='index.film.php?id={$row['id']}'>{$row['title']}</a></h2>
      <p class='ab'><span class='tt'>Год:</span> {$row['god']}</p>
      <p class='ab'><span class='tt'>Страна:</span> {$row['country']}</p>
      <p class='ab'><span class='tt'>Жанр:</span> {$row['janr_text']}</p>
      <p class='ab'><span class='tt'>Режиссер:</span> {$row['rezhiser']}</p>
      <p class='ab'><span class='tt'>Краткое описание:</span></p>
      <div class='infoner'>{$row['mini_description']}</div>
      </div>  
     <div class='pick'>
    <a class='link1' href='index.film.php?id={$row['id']}'>{$row['images']}</a>
    <div class='ocenka'>
    <span class='rati'>IMDb :</span><span class='rat'> {$row['imdb']}</span></br>
    <span class='rati'>КиноПоиск :</span><span class='rat'> {$row['kinopoisk']}</span>
    </div>
    </div>
    </div> 
           ";     
    }
    }
    else{
        echo"
        <p class='no_result'>Нет результатов, попробуйте еще!!!</p>
        <div class=''><img src='/images/minion.jpg' /></div>    
        ";    
    };
    ?>
    <?php
    if ($page != 1){ $pstr_prev = '<li><a class="pstr-prev" href="index-search_select_dop.php?xar='."$xar".'&tip='."$tip".'&det='."$det".'&page='.($page - 1).'">&lt;</a></li>';}
    if ($page != $total) $pstr_next = '<li><a class="pstr-next" href="index-search_select_dop.php?xar='."$xar".'&tip='."$tip".'&det='."$det".'&page='.($page + 1).'">&gt;</a></li>';
    // Находим две ближайшие станицы с обоих краев, если они есть
    if($page - 3 > 0) $page3left = '<li><a href="index-search_select_dop.php?xar='."$xar".'&tip='."$tip".'&det='."$det".'&page='.($page - 3).'">'.($page - 3).'</a></li>';
    if($page - 2 > 0) $page2left = '<li><a href="index-search_select_dop.php?xar='."$xar".'&tip='."$tip".'&det='."$det".'&page='.($page - 2).'">'.($page - 2).'</a></li>';
    if($page - 1 > 0) $page1left = '<li><a href="index-search_select_dop.php?xar='."$xar".'&tip='."$tip".'&det='."$det".'&page='.($page - 1).'">'.($page - 1).'</a></li>';
    if($page + 6 <= $total) $page6right = '<li><a href="index-search_select_dop.php?xar='."$xar".'&tip='."$tip".'&det='."$det".'&page='.($page + 6).'">'.($page + 6).'</a></li>';
    if($page + 5 <= $total) $page5right = '<li><a href="index-search_select_dop.php?xar='."$xar".'&tip='."$tip".'&det='."$det".'&page='.($page + 5).'">'.($page + 5).'</a></li>';
    if($page + 4 <= $total) $page4right = '<li><a href="index-search_select_dop.php?xar='."$xar".'&tip='."$tip".'&det='."$det".'&page='.($page + 4).'">'.($page + 4).'</a></li>';
    if($page + 3 <= $total) $page3right = '<li><a href="index-search_select_dop.php?xar='."$xar".'&tip='."$tip".'&det='."$det".'&page='.($page + 3).'">'.($page + 3).'</a></li>';
    if($page + 2 <= $total) $page2right = '<li><a href="index-search_select_dop.php?xar='."$xar".'&tip='."$tip".'&det='."$det".'&page='.($page + 2).'">'.($page + 2).'</a></li>';
    if($page + 1 <= $total) $page1right = '<li><a href="index-search_select_dop.php?xar='."$xar".'&tip='."$tip".'&det='."$det".'&page='.($page + 1).'">'.($page + 1).'</a></li>';
    if ($page+7 < $total)
    {
        $strtotal = '<li><p class="nav-point">...</p></li><li><a href="index-search_select_dop.php?xar='."$xar".'&tip='."$tip".'&det='."$det".'&page='.$total.'">'.$total.'</a></li>';
    }else
    {
        $strtotal = ""; 
    }
    
    if ($total > 1)
    {
        echo '
        <div class="pstrnave">
        <ul style="margin-left: -11px;">
        ';
        echo $pstr_prev.$page3left.$page2left.$page1left."<li><a class='pstr-active' href='index-search_select_dop.php?xar='.$xar.'&tip='.$tip.'&det='.$det.'&page=".$page."'>".$page."</a></li>".$page1right.$page2right.$page3right.$page4right.$page5right.$page6right.$strtotal.$pstr_next;
        echo '
        </ul>
        </div>
        ';   
    }    
    ?>
    </div>

    оригинал - https://toster.ru/q/331671

    loki90, 27 Июня 2016

    Комментарии (14)
  2. C++ / Говнокод #20279

    −1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    GUIButton::GUIButton(ResourceManager& resourceManager, const Renderer& renderer,
            const Config& config, std::string name, Action action,
            int x, int y, int width, int height) :
        GUIButton{std::move(name), std::move(action),
            resourceManager.load<Font>("font_button_" + name,
                    config.findValue<std::string>("button", "font"),
                    config.findValue<int>("button", "font_size")),
            resourceManager.load<TextureAtlas>("atlas_button", resourceManager, renderer,
                    Config{config.findValue<std::string>("button", "atlas_config")}), x, y, width, height}
    {
    }

    jangolare, 27 Июня 2016

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

    +2

    1. 1
    https://m.reddit.com/r/cpp/comments/4pmlpz/what_the_iso_c_committee_added_to_the_c17_working/

    Мне остаётся только спросить:

    laMer007, 26 Июня 2016

    Комментарии (68)
  4. C++ / Говнокод #20272

    +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
    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
    void MyZKbMain::keyPressEvent(QKeyEvent* k)
    {
    	QPixmap pm; pm.load("ruleta_usr.png");
    	ZConfig Num(QString("numeros.cfg"), true);
    	ZConfig Hist(QString("historial.cfg"), true);
    
    	switch (k->key())
    	{
    	case 0x1046: //Boton Verde
    	break;
    
    	case 0x1030: //Boton Verde
    	calcular=0;
    	reboot = new ZMessageDlg("zRoulette", 
    		QString("Sistema Ubeda 0.5\nBasado en el Sistema de Cuadros\n\nwww.developermoto.com/es\nwww.modmymoto.com\n\n(C)2009 RacingLocura07, CepiPerez"), 
    		(ZMessageDlg::MessageDlgType)2, 0, this,"about", true, 0);
    	reboot->setTitleIcon(pm); reboot->show();
    	break;
    
    	case 0x1031: //Boton Rojo
    	calcular=0;
    	reboot = new ZMessageDlg("zRoulette", "Desea salir?", 
    			(ZMessageDlg::MessageDlgType)1, 0, this,"about", true, 0);
    	reboot->setTitleIcon(pm); reboot->show();
    	if(reboot->exec()==1) { exit(); }
    	else { update(); break; }
    	
    	case 0x1012: //Tecla de Navegacion De Izquierda
    	calcular=0;
    	if (current > 1 ) { --current; update(); break; } else { break; }
    
    	case 0x1013: //Tecla de Navegacion De Arriba
    	calcular=0;
    	if ( current > 3 ) { ------current; update(); break; } else { break; }
    
    	case 0x1014: //Tecla de Navegacion De Derecha
    	calcular=0;
    	if (current < 36 ) { ++current; update(); break; } else { break; }
    
    	case 0x1015: //Tecla de Navegacion De Abajo
    	calcular=0;
    	if (current < 34 ) { ++++++current; update(); break; } else { break; }
    
    	case 0x1038: //Softkey Izquierda
    	calcular=0;
    	reboot = new ZMessageDlg("zRoulette", "Desea reinciar la Ruleta?", (ZMessageDlg::MessageDlgType)1, 0, this,"about", true, 0);
    	reboot->setTitleIcon(pm); reboot->show();
    	if(reboot->exec()==1) { system("rm numeros.cfg"); system("rm historial.cfg"); current = 1; jugadas = 0; lista.clear(); update(); break; }
    	else { update(); break; }
    
    	case 0x103a: //Softkey Derecha
    	int temp = Hist.readNumEntry ( QString("HISTORIAL"), QString("18"), 0 );
    	if ( temp != 0 ) {
    		reboot = new ZMessageDlg("zRoulette", "Desea limpiar las jugadas dejando las ultimas 18 solamente?", 
    				(ZMessageDlg::MessageDlgType)1, 0, this,"about", true, 0); reboot->setTitleIcon(pm); reboot->show();
    		if(reboot->exec()==1) { 
    		  for ( int l=1; l<37; ++l) { Num.writeEntry ( QString("NUMEROS"), QString("%1").arg(l), QString("0") ); }
    		  for ( int j=1; j<19; ++j) {
    			int temp = Hist.readNumEntry ( QString("HISTORIAL"), QString("%1").arg(j), 0 );
    			if ( temp > 0 ) { Num.writeEntry ( QString("NUMEROS"), QString("%1").arg(temp), QString("1") ); }
    		  }	calcular=1; update(); break; 
    		} else { break; }
    	} else {
    		reboot = new ZMessageDlg("zRoulette", "Deben haber mas de 18 bolas jugadas para el reinicio parcial.", 
    			(ZMessageDlg::MessageDlgType)2, 0, this,"about", true, 0); reboot->setTitleIcon(pm); reboot->show(); break;
    	}
    
    	case 0x1004:  //Boton Central
    	valortemp = Num.readNumEntry(QString("NUMEROS"), QString("%1").arg(current), 0 );
    	if ( valortemp < 1 ) { valortemp=0; } ++valortemp;
    	Num.writeEntry(QString("NUMEROS"), QString("%1").arg(current), valortemp);
    
    	int lugar=0; for ( int j=18; j>0; --j)
    	{ int temp = Hist.readNumEntry ( QString("HISTORIAL"), QString("%1").arg(j), 0 ); if ( temp==0 ) { lugar=j; } }
    	
    	if ( lugar > 0 ) {
    	  Hist.writeEntry ( QString("HISTORIAL"), QString("%1").arg(lugar), QString("%1").arg(current) );
    	} else {
    	  for ( int j=1; j<18; ++j) {
    		int temp = Hist.readNumEntry ( QString("HISTORIAL"), QString("%1").arg(j+1), 0 ); 
    		Hist.writeEntry ( QString("HISTORIAL"), QString("%1").arg(j), QString("%1").arg(temp) ); 
    	  }
    	  Hist.writeEntry ( QString("HISTORIAL"), QString("18"), QString("%1").arg(current) ); 
    	}
    	calcular=1;
    	update();
    	}
    }

    Разработчики из солнечной Аргентины. Кусочек кода из кастомного "лаунчера" для телефонов Motorola на платформе MotoMAGX (Linux 2.6.10, Qt 2.3.8, gcc 3.4.3). АДИЩЕ С ЦАРСКИМИ АНРОЛЛАМИ: https://github.com/crutchwalkfactory/motocakerteam/blob/master/Projects/MotoDesk/MyZKbMain.cpp

    Что интересно, это всё как-то работало и даже довольно мило выглядело: http://exlmoto.ru/wp-content/Images/AOne/1.gif

    Tsiklonyashka, 26 Июня 2016

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

    +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
    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
    #include "stdafx.h"
    #include <Windows.h>
    #pragma comment(lib, "gdiplus.lib")
    #include <gdiplus.h>
    #include <vector>
    #include <chrono>
    
    wchar_t* path =
    L"здесь был путь*";
    
    using namespace Gdiplus;
    using namespace std::chrono;
    
    int main()
    {
    	GdiplusStartupInput gdipInput;
    	ULONG_PTR gdipToken;
    	GdiplusStartup(&gdipToken, &gdipInput, NULL);
    	HWND progman = FindWindowW(L"Progman", NULL);
    	HWND workerw = GetWindow(progman, GW_HWNDPREV);
    	HDC dc = GetDC(workerw);
    	
    	std::vector<Bitmap*> images;
    	WIN32_FIND_DATAW fdata = { 0 };
    	HANDLE hFind = FindFirstFileW(path, &fdata);
    	int
    		scrWidth = GetSystemMetrics(SM_CXSCREEN),
    		scrHeight = GetSystemMetrics(SM_CYSCREEN);
    	UINT width, height;
    	bool isInfoRetrieved = false;
    	std::wstring wmp(path);
    	wmp = wmp.substr(0, wmp.length() - 1);
    	do {
    		Bitmap* bmp = Bitmap::FromFile((wmp + fdata.cFileName).c_str());
    		if (bmp->GetLastStatus() != Gdiplus::Ok) continue;
    		int width = bmp->GetWidth();
    		int height = bmp->GetHeight();
    		double ratio = (double)width / height;
    		if (ratio > 1) {
    			width = scrWidth;
    			height = scrWidth / ratio;
    		}
    		else {
    			width = scrHeight * ratio;
    			height = scrHeight;
    		}
    		Bitmap* resized = new Bitmap(width, height, PixelFormat32bppRGB);
    		Graphics* resizedGr = Graphics::FromImage(resized);
    		resizedGr->DrawImage(bmp, 0, 0, width, height);
    		delete resizedGr;
    		delete bmp;
    		images.push_back(resized);
    	} while (FindNextFile(hFind, &fdata));
    	FindClose(hFind);
    	
    	Graphics* mainGr = Graphics::FromHDC(dc);
    	Bitmap* bufBmp = new Bitmap(scrWidth, scrHeight, PixelFormat32bppRGB);
    	Graphics* bufGr = Graphics::FromImage(bufBmp);
    	
    	int count = images.size();
    	int gap = 1000 / count;
    
    	while (true) {
    		for (auto it = images.begin(); it != images.end(); it++) {
    			milliseconds ms1 = duration_cast<milliseconds>(
    				system_clock::now().time_since_epoch());
    			Bitmap* bmp = *it;
    			int width = bmp->GetWidth();
    			int height = bmp->GetHeight();
    			int xOfs = (scrWidth - width) / 2, yOfs = (scrHeight - height) / 2;
    			bufGr->Clear(Color::Black);
    			bufGr->DrawImage(*it, xOfs, yOfs, width, height);
    			mainGr->DrawImage(bufBmp, 0, 0);
    			milliseconds ms2 = duration_cast<milliseconds>(
    				system_clock::now().time_since_epoch());
    			milliseconds delta = ms2 - ms1;
    			if (gap > delta.count())
    				Sleep(gap - delta.count());
    		}
    	}
    	return 0;
    }

    Код для рисования под иконками рабочего стола на винде
    Да, в винде можно так делать

    Нахуй никому не нужно, но выглядит заебись

    cykablyad, 26 Июня 2016

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

    +3

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    Оффтоп
    
    Пишу либу для гуя в консоли. Столкнулся с проблемой медленного вывода в консоль на линуксе.
    На винде есть няшный WriteConsoleOutput, который может вывести буфер разом на консоль, в линупсе ничего подобного не нашел.
    Если использовать Console.WriteLine или libc-шный puts, все лагает неимоверно
    
    Есть идеи?

    cykablyad, 24 Июня 2016

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

    0

    1. 1
    2. 2
    3. 3
    if (strpos($route, ':') !== false) {
                    $route = str_replace(':any', '([^/]+)', str_replace(':num', '([0-9]+)', str_replace(':all', '(.+)', $route)));
                }

    Очередная обезьяна села высерать свои мысли на PHP ... Уже много говорили тут о mpak и его "cms", вот вам еще одно "чудо": https://github.com/wolfcms/wolfcms

    zenn1989, 24 Июня 2016

    Комментарии (56)
  8. 1C / Говнокод #20263

    −99

    1. 1
    http://1c.ru/news/info.jsp?id=21537

    ну не вирус конечно, но первый дропер на 1С

    znsoft, 24 Июня 2016

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

    +2

    1. 1
    2. 2
    const size_t longstring_size = 1000500; // TODO: O RLY magic constant? => Can't load edges >= 1Mbp
            char longstring[longstring_size];

    Орфография комментариев сохранена.

    Yuuri, 23 Июня 2016

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

    +2

    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
    using System;
    using System.Collections.Generic;
    using System.Net;
    using System.Web.Script.Serialization;
    
    namespace Govnokod
    {
    	public class Program
    	{
    		private static string input;
    		private static string[] inputargs;
    		private static int inputargsh = 0;
    
    		private static int eax;
    		private static string hax,hbx;
    
    		public static void CommandActions()
    		{
    			if (inputargs[0] == "download")
    			{
    				if (inputargsh > 1)
    				{
    					hax = inputargs[1];
    					hbx = (inputargsh > 2) ? inputargs[2]:null;
    					if (String.IsNullOrEmpty(hbx))
    						hbx = Environment.CurrentDirectory+"\\"+hax;
    					Console.WriteLine("Downloading...");
    				}
    				else Console.WriteLine("invalid argument: 1\n");
    			}
    			else if (inputargs[0] == "apkinfo")
    			{
    				if (inputargsh > 1)
    				{
    					Console.WriteLine("Apkinfo...");
    				}
    				else Console.WriteLine("invalid argument: 1\n");
    			}
    			else if (input != "")
    				Console.WriteLine("invalid command: "+input+"\n");
    			CommandStart();
    		}
    
    		public static void CommandStart()
    		{
    			if (inputargsh != 0)
    			{
    				Array.Clear(inputargs,0,inputargsh);
    				inputargsh = 0;
    			}
    			input = Console.ReadLine();
    			input = input.Trim();
    			hax = input.ToLower();
    			while (true)
    			{
    				eax = hax.IndexOf(' ');
    				Array.Resize(ref inputargs,inputargsh+1);
    				if (eax != -1)
    				{
    					inputargs[inputargsh] = hax.Substring(0,eax);
    					hax = hax.Substring(eax);
    					hax = hax.TrimStart();
    					inputargsh++;
    				}
    				else
    				{
    					inputargs[inputargsh] = hax;
    					inputargsh++;
    					hax = null;
    					break;
    				}
    			}
    			if (inputargs[0] == "quit")
    			{
    				Console.Clear();
    				Console.Write("Press any key to quit...");
    				Console.ReadKey();
    			}
    			else CommandActions();
    		}
    
    		public static void Main(string[] args)
    		{
    			Console.WriteLine("; Commands:");
    			Console.WriteLine(";\tdownload <apk> <path>");
    			Console.WriteLine(";\tapkinfo <apk> or <index>");
    			Console.WriteLine(";\tquit <>\n");
    			CommandStart();
    		}
    	}
    }

    "Распознователь Команд 6120"

    ReckitRockefeller, 23 Июня 2016

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