post the code that works in some other language, then maybe, MAYBE, someone might then take an interest in helping translate it
because that’s likely the only source of your problem, but i doubt anyone will figure it out as is
this translated code apparently has an error, though at least one person (roaminggamer) ran it without error, and you refuse to tell us exactly what the error actually IS (instead you just keep saying “same code runs in other languages” - which can’t be true, this MUST have been translated)
plus there’s lots of “mystery stuff” in there, like passing two values to randomseed, or “math.random()<5” which will always evaluate true, or indexing by 10’s when you only have 8 col/row, plus the few comments present are in german (not my native), obscure variable names, etc – maybe it works, maybe it doesn’t, but it’s just too weird for most of us casual helpers to spend enough time on to figure it out for you.