Execute a Markov algorithm: Difference between revisions

Apply some sane formatting characteristics, thereby fixing the TOC position.
(Removed mention of "stretch" goals; they're just input datasets that ensure correct implementation of the rules.)
(Apply some sane formatting characteristics, thereby fixing the TOC position.)
Line 11:
 
In order to promote flexibility, the interpreter should load the set of rules from one file, take the string to operate on from a second file, and write the output to a third.
 
=Rulesets=
 
Use the following three tests on entries:
 
'''==Ruleset 1:'''<pre>==
# This rules file is extracted from Wikipedia:
# http://en.wikipedia.org/wiki/Markov_Algorithm
Line 29 ⟶ 31:
: <code>I bought a bag of apples from my brother.</code>
 
'''==Ruleset 2:'''<br>==
A test of the terminating rule
<pre>
Line 44 ⟶ 46:
: <code>I bought a bag of apples from T shop.</code>
 
'''==Ruleset 3:'''<br>==
This tests for correct substitution order and may trap simple regexp based replacement routines if special regexp characters are not escaped.
<pre># BNF Syntax testing rules
Line 62 ⟶ 64:
: <code>I bought a bag of apples with my money from T shop.</code>
 
'''==Ruleset 4:'''<br>==
This tests for correct order of scanning of rules, and may trap replacement routines that scan in the wrong order. It implements a general unary multiplication engine. (Note that the input expression must be placed within underscores in this implementation.)
<pre>
Line 99 ⟶ 101:
: <code>11111111111111111111</code>
 
'''==Ruleset 5:'''<br>==
A simple Turing machine, implementing a three-state busy beaver. The tape consists of 0s and 1s, the states are A, B, C and H (for Halt), and the head position is indicated by writing the state letter before the character where the head is. All parts of the initial tape the machine operates on have to be given in the input.
 
Line 128 ⟶ 130:
: <code>00011H1111000</code>
 
=Examples=
=={{header|C}}==