Anonymous user
Execute a Markov algorithm: Difference between revisions
→{{header|D}}: better not use capitals, they have a special meaning
(Simplified D code) |
(→{{header|D}}: better not use capitals, they have a special meaning) |
||
Line 949:
void main() {
auto
auto
foreach (i,
string[][] capt;
foreach (line;
auto m = match(line, r"^([^#]*?)\s+->\s+(\.?)(.*)");
if (!m.empty) capt ~= array(m.captures)[1 .. $];
}
▲ REDO: auto copy = T[i];
foreach (c; capt) {
if (c[1] == ".") break;
if (
}
writeln(
}
}</lang>
|