<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9240&amp;view=findpost&amp;p=250538</guid>
        <pubDate>Sun, 23 Nov 2003 00:57:58 +0000</pubDate>
        <title>Волновой алгоритм</title>
        <link>https://forum.sources.ru/index.php?showtopic=9240&amp;view=findpost&amp;p=250538</link>
        <description><![CDATA[Black_Star:  А кто на дату создания смотрит?<br>Смотрят по последней дате. Последняя 16.11.03. Алгоритма нету? Нету. Вот и привел ссылку.<br>Ссылку кстати еще ты мне подкинул дааавненько...  <!--emo&:D--><img src='http://forum.sources.ru/html/emoticons/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /><!--endemo-->  Вот и пригодилась. ]]></description>
        <author>Black_Star</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9240&amp;view=findpost&amp;p=250118</guid>
        <pubDate>Sat, 22 Nov 2003 03:23:06 +0000</pubDate>
        <title>Волновой алгоритм</title>
        <link>https://forum.sources.ru/index.php?showtopic=9240&amp;view=findpost&amp;p=250118</link>
        <description><![CDATA[Shiru_Otaku: А дату создания темы ты см. ?;) Не понимаю, зачем надо давать ответ на вопрос, заданный хз когда, да ещё и при наличии нескольких полных ответов в теме;)]]></description>
        <author>Shiru_Otaku</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9240&amp;view=findpost&amp;p=250089</guid>
        <pubDate>Fri, 21 Nov 2003 22:48:19 +0000</pubDate>
        <title>Волновой алгоритм</title>
        <link>https://forum.sources.ru/index.php?showtopic=9240&amp;view=findpost&amp;p=250089</link>
        <description><![CDATA[Black_Star:  Алгоритм <a href='http://pmg-ru.narod.ru/russian/navigato.htm' target='_blank'>см тут</a> ]]></description>
        <author>Black_Star</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9240&amp;view=findpost&amp;p=246303</guid>
        <pubDate>Sun, 16 Nov 2003 14:18:18 +0000</pubDate>
        <title>Волновой алгоритм</title>
        <link>https://forum.sources.ru/index.php?showtopic=9240&amp;view=findpost&amp;p=246303</link>
        <description><![CDATA[Arsenal: <!--QuoteBegin-Jin X+10.07.03, 21:09--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Jin X @ 10.07.03, 21:09)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Ничего, если на паскале?<br> <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd--><br> На Паскале очень даже ничего...<br><br>Я захотел посмотреть, что тут делается, запустил под ХР найденый в сети ТР 7.0, а он на эту программу (впрочем и на нижнюю тоже) ругается давно не виданным сообщением: Деление на нуль, ошибка 200. При этом родные туториалы компилит и исполняет нормально, то есть сам Пасик не битый. В чем моя ошибка? Откуда &quot;груз 200&quot;?<br> ]]></description>
        <author>Arsenal</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9240&amp;view=findpost&amp;p=90633</guid>
        <pubDate>Sat, 12 Jul 2003 13:57:48 +0000</pubDate>
        <title>Волновой алгоритм</title>
        <link>https://forum.sources.ru/index.php?showtopic=9240&amp;view=findpost&amp;p=90633</link>
        <description><![CDATA[Danaris: Волновой алгоритм:<br><div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">Program Voln;&#60;br&#62;&#60;br&#62;Uses Crt;&#60;br&#62;&#60;br&#62;Const&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; Map : array [1..10, 1..10] of Byte =&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; (&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(0, 0, 1, 0, 0, 0, 0, 0, 0, 0),&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(1, 0, 0, 0, 0, 1, 0, 0, 1, 0),&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(0, 0, 0, 1, 1, 1, 0, 0, 1, 1),&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(0, 1, 0, 0, 0, 1, 0, 0, 1, 0),&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(0, 0, 0, 0, 1, 1, 1, 0, 1, 0),&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(0, 0, 1, 1, 1, 0, 1, 0, 0, 0),&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(0, 0, 0, 1, 0, 0, 1, 0, 0, 0),&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(1, 1, 0, 1, 0, 0, 1, 1, 1, 0),&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(0, 1, 0, 0, 0, 0, 1, 0, 0, 0),&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(0, 1, 0, 0, 0, 0, 1, 0, 0, 0)&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; );&#60;br&#62;&#60;br&#62;var&#60;br&#62;&#60;br&#62; &nbsp; XS, YS, XE, YE : Byte;&#60;br&#62;&#60;br&#62; &nbsp; X, Y, I : Byte;&#60;br&#62;&#60;br&#62; &nbsp; MapM : array [1..10, 1..10] of Byte;&#60;br&#62;&#60;br&#62; &nbsp; Moves : Byte;&#60;br&#62;&#60;br&#62; &nbsp; MovesX : array [1..100] of Byte;&#60;br&#62;&#60;br&#62; &nbsp; MovesY : array [1..100] of Byte;&#60;br&#62;&#60;br&#62;Procedure Next(Var X, Y : Byte);&#60;br&#62;&#60;br&#62;Begin&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; If (X &#60;10) and (MapM[X, Y] - MapM[X + 1, Y] = 1) then&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp;Begin&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; X := X + 1;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Exit;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp;End;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; If (X &#62;1) and (MapM[X, Y] - MapM[X - 1, Y] = 1) then&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp;Begin&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; X := X - 1;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Exit;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp;End;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; If (Y &#60;10) and (MapM[X, Y] - MapM[X, Y + 1] = 1) then&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp;Begin&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Y := Y + 1;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Exit;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp;End;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; If (Y &#62;1) and (MapM[X, Y] - MapM[X, Y - 1] = 1) then&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp;Begin&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Y := Y - 1;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Exit;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp;End;&#60;br&#62;&#60;br&#62;End;&#60;br&#62;&#60;br&#62;Begin&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; ClrScr;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; For Y := 1 to 10 do&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; Begin&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;For X := 1 to 10 do Write(Map[X, Y], &#39; &#39;);&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WriteLn;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; End;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; WriteLn(&#39;Please enter X and Y of the start: &#39;);&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; ReadLn(XS, YS);&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; WriteLn(&#39;Please enter X and Y of the end: &#39;);&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; ReadLn(XE, YE);&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; If (Map[XS, YS] = 1) or (Map[XE, YE] = 1) then&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp;Begin&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WriteLn(&#39;Error!!!&#39;);&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ReadLn;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Halt;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp;End;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; MapM[XS, YS] := 1;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; I := 1;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; Repeat&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I := I + 1;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; For Y := 1 to 10 do&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; For X := 1 to 10 do&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If MapM[X, Y] = I - 1 then&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Begin&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If (Y &#60;10) and (MapM[X, Y + 1] = 0) &#60;br&#62;and (Map[X, Y+1] = 0) Then MapM[X, Y+1] := I;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If (Y &#62;1) &#60;br&#62;and (MapM[X, Y-1] = 0) and (Map[X, Y-1] = 0) Then MapM[X, Y-1] := I;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If (X &#60;10) &#60;br&#62;and (MapM[X+1, Y] = 0) and (Map[X+1, Y] = 0) Then MapM[X+1, Y] := I;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If (X &#62;1) &#60;br&#62;and (MapM[X-1, Y] = 0) and (Map[X-1, Y] = 0) Then MapM[X-1, Y] := I;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; If I = 100 then&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Begin&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WriteLn(&#39;You can&#39;&#39;t go there!!!&#39;);&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ReadLn;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Halt;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; Until MapM[XE, YE] &#62;0;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; Moves := I - 1;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; X := XE;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; Y := YE;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; I := Moves;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; Map[XE, YE] := 4;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; Repeat&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MovesX[I] := X;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MovesY[I] := Y;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Next(X, Y);&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Map[X, Y] := 3;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I := I - 1;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; Until (X = XS) and (Y = YS);&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; Map[XS, YS] := 2;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; For I := 1 to Moves do WriteLn(&#39;X = &#39;, MovesX[I],&#39;, Y = &#39;, MovesY[I]);&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; WriteLn(&#39;Total: &#39;, Moves, &#39; moves&#39;);&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; ReadLn;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; For Y := 1 to 10 do&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; Begin&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;For X := 1 to 10 do Write(Map[X, Y], &#39; &#39;);&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WriteLn;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; End;&#60;br&#62;&#60;br&#62; &nbsp; &nbsp; ReadLn;&#60;br&#62;&#60;br&#62;End.&#60;br&#62;</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script>]]></description>
        <author>Danaris</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9240&amp;view=findpost&amp;p=90632</guid>
        <pubDate>Sat, 12 Jul 2003 09:34:58 +0000</pubDate>
        <title>Волновой алгоритм</title>
        <link>https://forum.sources.ru/index.php?showtopic=9240&amp;view=findpost&amp;p=90632</link>
        <description><![CDATA[Antipich: А причём тут дельфя вообще, тему ИМХО в алгоритмы надо.]]></description>
        <author>Antipich</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9240&amp;view=findpost&amp;p=90631</guid>
        <pubDate>Thu, 10 Jul 2003 23:29:30 +0000</pubDate>
        <title>Волновой алгоритм</title>
        <link>https://forum.sources.ru/index.php?showtopic=9240&amp;view=findpost&amp;p=90631</link>
        <description><![CDATA[Shiru_Otaku: Я не понимаю вопроса. Сказано - надо разработать алгоритм. В сабже стоит название алгоритма, который замечательным образом решает поставленную задачу. В чём проблема? Реализовать?]]></description>
        <author>Shiru_Otaku</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9240&amp;view=findpost&amp;p=90630</guid>
        <pubDate>Thu, 10 Jul 2003 18:09:56 +0000</pubDate>
        <title>Волновой алгоритм</title>
        <link>https://forum.sources.ru/index.php?showtopic=9240&amp;view=findpost&amp;p=90630</link>
        <description><![CDATA[Jin X: Ничего, если на паскале?<br><br><div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">Uses Crt;&#60;br&#62;Const&#60;br&#62; &nbsp; Wall = #254;&#60;br&#62; &nbsp; Move = #250;&#60;br&#62; &nbsp; Nk = 250;&#60;br&#62;&#60;br&#62;Var&#60;br&#62; &nbsp; R: array [0..79, 0..49] of Byte;&#60;br&#62; &nbsp; Ni: Byte;&#60;br&#62; &nbsp; FX, FY: Byte;&#60;br&#62; &nbsp; i, j: Word;&#60;br&#62;&#60;br&#62;Procedure Init;&#60;br&#62;Begin&#60;br&#62; &nbsp; For j := 0 to 49 do&#60;br&#62; &nbsp; &nbsp; &nbsp;For i := 0 to 79 do&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; If (i in [0, 79]) or (j in [0, 49]) then R[i, j] := 255&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; else Case Mem[$B800:j*160+i*2] of&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;32: R[i, j] := 254;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Ord(&#39;X&#39;): R[i, j] := 0;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1: R[i, j] := 253;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else R[i, j] := 255&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; End;&#60;br&#62; &nbsp; Ni := 0&#60;br&#62;End;&#60;br&#62;&#60;br&#62;Procedure Clear;&#60;br&#62;Begin&#60;br&#62; &nbsp; For j := 1 to 48 do&#60;br&#62; &nbsp; &nbsp; &nbsp;For i := 1 to 78 do&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; Case Mem[$B800:j*160+i*2] of&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Ord(Move):&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Begin&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GotoXY(i, j);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Write(&#39; &#39;#8)&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2:&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Begin&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GotoXY(i, j);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Write(#1#8)&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; End&#60;br&#62;End;&#60;br&#62;&#60;br&#62;Procedure Start;&#60;br&#62;Var&#60;br&#62; &nbsp; Ok: Boolean;&#60;br&#62; &nbsp; X, Y, N, X1, Y1: Byte;&#60;br&#62;&#60;br&#62; Procedure Check(X, Y: Byte);&#60;br&#62; Begin&#60;br&#62; &nbsp; &nbsp;Case R[X, Y] of&#60;br&#62; &nbsp; &nbsp; &nbsp; 253: Ok := True;&#60;br&#62; &nbsp; &nbsp; &nbsp; 254: R[X, Y] := Ni+1&#60;br&#62; &nbsp; &nbsp;End&#60;br&#62; End;&#60;br&#62;&#60;br&#62; Procedure Find(X, Y: Byte);&#60;br&#62; Begin&#60;br&#62; &nbsp; &nbsp;If R[X, Y] &#60; N then&#60;br&#62; &nbsp; &nbsp;Begin&#60;br&#62; &nbsp; &nbsp; &nbsp; N := R[X, Y];&#60;br&#62; &nbsp; &nbsp; &nbsp; X1 := X;&#60;br&#62; &nbsp; &nbsp; &nbsp; Y1 := Y&#60;br&#62; &nbsp; &nbsp;End&#60;br&#62; End;&#60;br&#62;&#60;br&#62;Begin&#60;br&#62; &nbsp; Init;&#60;br&#62; &nbsp; Ok := False;&#60;br&#62; &nbsp; Repeat&#60;br&#62; &nbsp; &nbsp; &nbsp;For j := 1 to 48 do&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; For i := 1 to 78 do&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; Begin&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;If Ok then Break;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;If R[i, j] = Ni then&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Begin&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Check(i, j-1);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Check(i+1, j);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Check(i, j+1);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Check(i-1, j)&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; End;&#60;br&#62; &nbsp; &nbsp; &nbsp;Inc(Ni)&#60;br&#62; &nbsp; Until Ok or (Ni &#62; Nk);&#60;br&#62; &nbsp; If Ok then&#60;br&#62; &nbsp; Begin&#60;br&#62; &nbsp; &nbsp; &nbsp;X := FX;&#60;br&#62; &nbsp; &nbsp; &nbsp;Y := FY;&#60;br&#62; &nbsp; &nbsp; &nbsp;TextAttr := ;&#60;br&#62; &nbsp; &nbsp; &nbsp;Repeat&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; N := 255;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; Find(X, Y-1);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; Find(X+1, Y);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; Find(X, Y+1);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; Find(X-1, Y);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; If R[X1, Y1] = 0 then Break;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; GotoXY(X1, Y1);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; Write(Move);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; X := X1;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; Y := Y1&#60;br&#62; &nbsp; &nbsp; &nbsp;Until False&#60;br&#62; &nbsp; End&#60;br&#62; &nbsp; else&#60;br&#62; &nbsp; Begin&#60;br&#62; &nbsp; &nbsp; &nbsp;TextAttr := E;&#60;br&#62; &nbsp; &nbsp; &nbsp;GotoXY(FX, FY);&#60;br&#62; &nbsp; &nbsp; &nbsp;Write(#2)&#60;br&#62; &nbsp; End;&#60;br&#62; &nbsp; TextAttr := F;&#60;br&#62; &nbsp; Window(1, 1, 80, 50);&#60;br&#62; &nbsp; GotoXY(3, 1);&#60;br&#62; &nbsp; Write(&#39;Итераций - &#39;, Ni, &#39;/250 &nbsp;&#39;#8#8);&#60;br&#62; &nbsp; If ReadKey = #0 then ReadKey;&#60;br&#62; &nbsp; TextAttr := F;&#60;br&#62; &nbsp; Window(2, 2, 80, 49);&#60;br&#62; &nbsp; Clear;&#60;br&#62; &nbsp; GotoXY(FX, FY)&#60;br&#62;End;&#60;br&#62;&#60;br&#62;Begin&#60;br&#62; &nbsp; TextMode(Co80+Font8x8);&#60;br&#62; &nbsp; TextAttr := E;&#60;br&#62; &nbsp; ClrScr;&#60;br&#62; &nbsp; GotoXY(3, 50);&#60;br&#62; &nbsp; Write(#27#26#24#25&#39; - Move; Space,Del,PgDn,Home,End,Tab - Wall; Insert - Man; PgUp - Target&#39;);&#60;br&#62; &nbsp; GotoXY(54, 1);&#60;br&#62; &nbsp; Write(&#39;ENTER - Start; ESC - Exit&#39;);&#60;br&#62; &nbsp; Window(2, 2, 79, 49);&#60;br&#62; &nbsp; TextAttr := F;&#60;br&#62; &nbsp; ClrScr;&#60;br&#62; &nbsp; Window(2, 2, 80, 49);&#60;br&#62; &nbsp; Repeat&#60;br&#62; &nbsp; &nbsp; &nbsp;Case ReadKey of&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; #00: Case ReadKey of&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#72: If WhereY &#62; 1 then GotoXY(WhereX, WhereY-1);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#75: If WhereX &#62; 1 then GotoXY(WhereX-1, WhereY);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#77: If WhereX &#60; 78 then GotoXY(WhereX+1, WhereY);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#80: If WhereY &#60; 48 then GotoXY(WhereX, WhereY+1);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#71: {Home}&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Begin&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If WhereY &#62; 1 then GotoXY(WhereX, WhereY-1);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If Mem[$B800:WhereY*160+WhereX*2] = 32 then&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Write(Wall+#8) else Write(&#39; &#39;#8);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If (FX = WhereX) and (FY = WhereY) then FX := 0&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#83: {Del}&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Begin&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If WhereX &#62; 1 then GotoXY(WhereX-1, WhereY);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If Mem[$B800:WhereY*160+WhereX*2] = 32 then&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Write(Wall+#8) else Write(&#39; &#39;#8);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If (FX = WhereX) and (FY = WhereY) then FX := 0&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#81: {PgDn}&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Begin&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If WhereX &#60; 78 then GotoXY(WhereX+1, WhereY);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If Mem[$B800:WhereY*160+WhereX*2] = 32 then&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Write(Wall+#8) else Write(&#39; &#39;#8);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If (FX = WhereX) and (FY = WhereY) then FX := 0&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#79: {End}&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Begin&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If WhereY &#60; 48 then GotoXY(WhereX, WhereY+1);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If Mem[$B800:WhereY*160+WhereX*2] = 32 then&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Write(Wall+#8) else Write(&#39; &#39;#8);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If (FX = WhereX) and (FY = WhereY) then FX := 0&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#59: {F1 - Clr}&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Begin&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; For j := 1 to 48 do&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;For i := 1 to 78 do&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Begin&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GotoXY(i, j);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Write(&#39; &#39;#8)&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FX := 0&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#60: {F2 - Fill}&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Begin&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; For j := 1 to 48 do&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;For i := 1 to 78 do&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Begin&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GotoXY(i, j);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Write(Wall+#8)&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FX := 0&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#73: {PgUp}&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Write(&#39;X&#39;#8);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#82: {Ins}&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Begin&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i:= WhereX;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; j := WhereY;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GotoXY(FX, FY);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Write(&#39; &#39;);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GotoXY(i, j);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Write(#1#8);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FX := i;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FY := j&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; End;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; #09: {Tab}&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;For Ni := 1 to 100 do&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Begin&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i := Random(78)+1;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; j := Random(48)+1;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If Mem[$B800:j*160+i*2] &#60;&#62; 1 then&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Begin&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;GotoXY(i, j);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Write(Wall+#8)&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; End&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; #32: {Space}&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; Begin&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;If Mem[$B800:WhereY*160+WhereX*2] = 32 then&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Write(Wall+#8) else Write(&#39; &#39;#8);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;If (FX = WhereX) and (FY = WhereY) then FX := 0&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; End;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; #13: {Enter}&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;If FX &#60;&#62; 0 then Start;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; #27: {Esc}&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Break&#60;br&#62; &nbsp; &nbsp; &nbsp;End&#60;br&#62; &nbsp; Until False;&#60;br&#62; &nbsp; TextMode(Co80);&#60;br&#62; &nbsp; TextAttr := 7;&#60;br&#62; &nbsp; ClrScr&#60;br&#62;End.</div></ol></div></div></div></div>]]></description>
        <author>Jin X</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9240&amp;view=findpost&amp;p=90629</guid>
        <pubDate>Thu, 10 Jul 2003 14:48:34 +0000</pubDate>
        <title>Волновой алгоритм</title>
        <link>https://forum.sources.ru/index.php?showtopic=9240&amp;view=findpost&amp;p=90629</link>
        <description><![CDATA[J_S: Нужно разработать алгоритм для обхода препятствий, причем припятствия бывают только прямоугольной формы и не могут &quot;пересекаться&quot;, а путь может состоять только из горизонтальных и вертикальных линий.<br>Я конечно пыталась придумать что-то, но никакого обьективного алгоритма не получилось.<br><br>P.S. Путь, конечно, должен быть наиболее краток.]]></description>
        <author>J_S</author>
        <category>Алгоритмы</category>
      </item>
	
      </channel>
      </rss>
	