Evolutionary algorithm: Difference between revisions

Line 4,552:
 
=={{header|m4}}==
This is written in POSIX m4, but seems to run bestleast annoyingly in GNU m4. You(For mayinstance, likeOpenBSD I,m4 losemay patienceresist waiting for itattempts to get that last character. But I have tested thatuse the programinterrupt terminates, by running it with a one-character targetkey. :)
 
You may, like I, lose patience waiting for it to get that last character. But I have tested that the program terminates, by running it with a one-character target. :)
 
Note that it writes to a file called ‘__random_number__’. The random number generator here is the best I have come up with that works in all the m4 implementations I have installed. (Something using sysval did not work in OpenBSD m4.)
 
This is not the best use of m4, and I am far from an m4 guru, but it hardly seemed likelyunlikely anyone else was going to write an m4 example for this task. The better my m4 skills, the better I am going to be at ''everything'' that can be preprocessed, and at GNU Autotools (which, unlike many, I like a lot). So I wrote this.
 
<lang m4>divert(-1)
1,448

edits