summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-01-10 13:43:03 +0100
committerErich Eckner <git@eckner.net>2019-01-10 13:43:03 +0100
commit59b84c6e478810112c88c67035c38006a01039be (patch)
tree451dbbd789d85d7a6fe281ec8b20435b12244ce1
parent4fe7c6670624c8a80a026d670d7c434898d9c716 (diff)
downloadmarkov-59b84c6e478810112c88c67035c38006a01039be.tar.xz
bail out on words longer than 256 characters
-rw-r--r--markov.lpr5
1 files changed, 5 insertions, 0 deletions
diff --git a/markov.lpr b/markov.lpr
index c2d27a0..005bf35 100644
--- a/markov.lpr
+++ b/markov.lpr
@@ -127,6 +127,11 @@ begin
break
else
s:=s+i2c[current mod (length(i2c)+1)];
+ if length(s)>256 then begin
+ dec(count);
+ s:=f[0];
+ break;
+ end;
until false;
if not f.hatZeile(s,false) then begin;
writeln(s);