<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Поиск последовательности.]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=13025</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=13025&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Поиск последовательности.».]]></description>
		<lastBuildDate>Mon, 02 Oct 2017 20:51:32 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Поиск последовательности.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119723#p119723</link>
			<description><![CDATA[<div class="quotebox"><cite>aktor311 пишет:</cite><blockquote><p>Здесь последовательность ******* самая длинная в порядке возрастания.</p></blockquote></div><p>Я про порядок возрастания так понял. Пусть ТС уточнит... Ну а так, да, во втором посте я также предположил.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 02 Oct 2017 20:51:32 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119723#p119723</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск последовательности.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119722#p119722</link>
			<description><![CDATA[<p>А что он должен показать?<br />Как я понял задание, то либо 1+2+3+4, либо 5+6+7+8.<br />В зхадание не уточняется какую последовательность показывать при одинаковых сериях, поэтому я выбрал первую.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Mon, 02 Oct 2017 20:45:28 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119722#p119722</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск последовательности.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119721#p119721</link>
			<description><![CDATA[<p><span class="bbu">Может быть</span>, так:<br /></p><div class="codebox"><pre><code>str = 68376123454132178

Loop, Parse, % (str, l := s := 0, pr := &quot;&quot;, a := {})
	f := A_LoopField, (f - pr = 1) ? (s += f, (a[++l] &lt; s &amp;&amp; a[l] := s)) : (l := 1, s := f), pr := f

MsgBox % str &quot;`n`nсумма: &quot; a[a.MaxIndex()] &quot;`nдлинна последовательности: &quot; a.MaxIndex()</code></pre></div><p><strong>Malcev</strong><br />Насколько я понял, неможно.<br /></p><div class="codebox"><pre><code>str = 123405678
Prev := &quot;&quot;, n := MaxN := Sum := MaxSum := 0
Loop, Parse, str
{
   if (A_LoopField -1 = Prev)
      Sum += A_LoopField, n++
   else
      Sum := A_LoopField, n := 1
   if (n &gt; maxN)
      maxN := n, MaxSum := Sum
   Prev := A_LoopField
}
msgbox % MaxSum</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 02 Oct 2017 20:38:27 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119721#p119721</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск последовательности.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119682#p119682</link>
			<description><![CDATA[<p>Так можно:<br /></p><div class="codebox"><pre><code>str = 68376123454132178
Prev := &quot;&quot;, n := MaxN := Sum := MaxSum := 0
Loop, Parse, str
{
   if (A_LoopField -1 = Prev)
      Sum += A_LoopField, n++
   else
      Sum := A_LoopField, n := 1
   if (n &gt; maxN)
      maxN := n, MaxSum := Sum
   Prev := A_LoopField
}
msgbox % MaxSum</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Mon, 02 Oct 2017 15:02:27 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119682#p119682</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск последовательности.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119669#p119669</link>
			<description><![CDATA[<p>Заметил ошибку у многоуважаемого serzh82saratov. У меня такой код выдает - 15:<br /></p><div class="codebox"><pre><code>str = 68376123454132178

 if str contains 1
q := 1
 if str contains 12
q := 1+2
 if str contains 123
q := 1+2+3
 if str contains 1234
q := 1+2+3+4
 if str contains 12345
q := 1+2+3+4+5
 if str contains 123456
q := 1+2+3+4+5+6
 if str contains 1234567
q := 1+2+3+4+5+6+7
 if str contains 12345678
q := 1+2+3+4+5+6+7+8
 if str contains 123456789
q := 1+2+3+4+5+6+7+8+9

MsgBox % q</code></pre></div><p>, а в коде serzh82saratov - 14.</p>]]></description>
			<author><![CDATA[null@example.com (svoboden)]]></author>
			<pubDate>Mon, 02 Oct 2017 13:29:37 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119669#p119669</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск последовательности.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119530#p119530</link>
			<description><![CDATA[<div class="codebox"><pre><code>Gui, Add, ListBox, x10 y10 w200 h240 vDm
Gui, Add, Button, y+ w200 h30 gSave1, Добавить цифры
Gui, Show,,%A_ScriptName%
return

Save1: 
	MsgBox, Запущено
	Input, Твои_цифры, L10, Esc
	GuiControl,,Dm,%Твои_цифры%
	MsgBox, Введено
	str := Твои_цифры
	Loop, Parse, % (str &quot;0&quot;, l := r := s := 0, pr := &quot;&quot;) 
		f := A_LoopField, (pr = &quot;&quot; || f - pr = 1) ? (pr := f, l++, s += f) 
		: ((l &gt; r &amp;&amp; (r := l, m := s)), l := s := 0, pr := &quot;&quot;)

	MsgBox, % m
	return
	
GuiClose:
GuiEscape:
	ExitApp</code></pre></div><p>Так работает, только зачем.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 23 Sep 2017 18:21:38 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119530#p119530</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск последовательности.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119529#p119529</link>
			<description><![CDATA[<p><strong>stealzy</strong><br />GuiControl использую что бы цифры, которые я ввел через Input, были показаны в Listbox.<br /></p><div class="codebox"><pre><code>Gui, Add, ListBox, x10 y10 w200 h240 vDm
Gui, Add, Button, y+ w200 h30 gSave1, Добавить цифры
Gui, Show,,%A_ScriptName%

Save1:
MsgBox, Запущено
Input , Твои_цифры, L10, Esc
GuiControl,,Dm,%Твои_цифры%
MsgBox, Введено
str := Dm
Loop, Parse, % (str &quot;0&quot;, l := r := s := 0, pr := &quot;&quot;) 
	f := A_LoopField, (pr = &quot;&quot; || f - pr = 1) ? (pr := f, l++, s += f) 
	: ((l &gt; r &amp;&amp; (r := l, m := s)), l := s := 0, pr := &quot;&quot;)

MsgBox, % Dm
return
GuiClose:
GuiEscape:
ExitApp</code></pre></div><p>Поменял выход на Dm. Ничего не изменилось.</p>]]></description>
			<author><![CDATA[null@example.com (aktor311)]]></author>
			<pubDate>Sat, 23 Sep 2017 17:37:10 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119529#p119529</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск последовательности.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119527#p119527</link>
			<description><![CDATA[<div class="codebox"><pre><code>MsgBox % &quot;Введено &quot; Dm ; что на входе, то и на выходе</code></pre></div><p>Зачем там GuiControl? Справку хоть посмотрите по команде, у вас там ахинея в параметрах.</p>]]></description>
			<author><![CDATA[null@example.com (stealzy)]]></author>
			<pubDate>Sat, 23 Sep 2017 17:15:25 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119527#p119527</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск последовательности.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119526#p119526</link>
			<description><![CDATA[<p>Спасибо. <br />Не подскажите, почему в конце в Msgbox не выводится ничего?<br /></p><div class="codebox"><pre><code>Gui, Add, ListBox, x10 y10 w200 h240 vDm
Gui, Add, Button, y+ w200 h30 gSave1, Добавить цифры
Gui, Show,,%A_ScriptName%
return
Save1:
MsgBox, Запущено
Input , Твои_цифры, L10, Esc
GuiControl,,Dm,%Твои_цифры%
MsgBox, Введено
str := Dm
Loop, Parse, % (str &quot;0&quot;, l := r := s := 0, pr := &quot;&quot;) 
	f := A_LoopField, (pr = &quot;&quot; || f - pr = 1) ? (pr := f, l++, s += f) 
	: ((l &gt; r &amp;&amp; (r := l, m := s)), l := s := 0, pr := &quot;&quot;)

MsgBox, % m
return
GuiClose:
GuiEscape:
ExitApp</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (aktor311)]]></author>
			<pubDate>Sat, 23 Sep 2017 16:51:38 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119526#p119526</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск последовательности.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119523#p119523</link>
			<description><![CDATA[<p>Или так.</p><div class="codebox"><pre><code>str = 123406789

Loop, Parse, % (str &quot;0&quot;, l := r := s := m := 0, pr := &quot;&quot;) 
	f := A_LoopField, (pr = &quot;&quot; || f - pr = 1) ? (pr := f, l++, s += f) 
	: ((l &gt;= r &amp;&amp; (r := l, m := s &gt; m ? s : m)), l := s := 0, pr := &quot;&quot;)
 
MsgBox % m</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 23 Sep 2017 13:20:23 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119523#p119523</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск последовательности.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119521#p119521</link>
			<description><![CDATA[<div class="codebox"><pre><code>str = 12345651784132156

Loop, Parse, % (str &quot;0&quot;, l := r := s := 0, pr := &quot;&quot;) 
	f := A_LoopField, (pr = &quot;&quot; || f - pr = 1) ? (pr := f, l++, s += f) 
	: ((l &gt; r &amp;&amp; (r := l, m := s)), l := s := 0, pr := &quot;&quot;)
 
MsgBox % m</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 23 Sep 2017 13:10:05 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119521#p119521</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Поиск последовательности.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119519#p119519</link>
			<description><![CDATA[<p>Возможно ли в AHK после введения цифр 0-9 (0123456789) в произвольном порядке, выполнить поиск максимально большой серии последовательных цифр в порядке возрастания, а потом сложить все цифры содержащиеся в этой серии?<br />Например:<br />12345651784132156<br />Здесь последовательность 123456 самая длинная в порядке возрастания.<br />И нужно сделать это:<br />1+2+3+4+5+6=21<br />Это все должно быть автоматизированно, кроме ввода самих цифр. Они вводятся с клавиатуры через Input.<br />Если возможно, то прошу помочь.</p>]]></description>
			<author><![CDATA[null@example.com (aktor311)]]></author>
			<pubDate>Sat, 23 Sep 2017 11:58:40 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119519#p119519</guid>
		</item>
	</channel>
</rss>
