Execute a Markov algorithm: Difference between revisions

Content added Content deleted
(D entry: i index => zip, assert lens => requireSameLength, no auto "rules" for understandability)
(→‎Examples: + МК-61/52)
Line 1,462: Line 1,462:
Output:
Output:
<pre>"00011H1111000"</pre>
<pre>"00011H1111000"</pre>

=={{header|МК-61/52}}==
<lang> 9 П4
КИП4 [x] П7 Вx {x} П8
ИП8 ИПE * П8 {x} x=0 08
П5 ИП9 П1 lg [x] 10^x П3
ИП1 П2
Сx П6
ИП2 ИП7 - x=0 72
ИП9 ^ lg [x] 1 + ИП5 - 10^x / [x]
ИП6 ИП8 x#0 50 lg [x] 1 + + 10^x *
ИП9 ^ ИП6 10^x П7 / [x] ИП7 * - +
ИП8 ИП7 * + П9
С/П БП 00
КИП6
ИП2 ИПE / [x] П2
x=0 26
КИП5
ИП1 ^ ИП3 / [x] ИП3 * - П1
ИП3 ИПE / [x] П3
x=0 22
ИП4 ИП0 - 9 - x=0 02 С/П</lang>

Under the rules of left 4 registers, under the word has 8 character cells, the alphabet of the digits from 1 to 8. Rules are placed in "123,456", where "123" is a fragment, and "456" is to be replaced, in the registers of the РA to РD. The number of rules is stored in Р0, the initial word is in Р9. Number triggered rule is the last digit registration Р4 (0 to 3), if no rule did not work, the indicator 0, otherwise the current word to be processed. In РE is stored 10.


=={{header|Perl}}==
=={{header|Perl}}==