# How to show that a turtle graphic language is not regular?

I have to prove with the pumping lemma that $L$ is not regular or to give a regular expression for that.

Let $L$ be all combinations of commands such that in the complete drawn result no line is drawn above another. At the starting point the pen is down.

The turtle graphic is created by the following commands:

u - pen up
d - pen down
g - go
l - move 10° left
r - move 10° right


I think think that the language is not regular because I think there is an expression that crosses a line for a big enough $n \in \mathbb N$.

Question: How can I find an expression that helps me to prove that this language is not regular to use the pumping lemma?

And if the language is regular, what technique should I use to find a regular expression?

• What are the semantics of your language? What does it mean for a line to be crossed? – Yuval Filmus Jun 6 '17 at 10:50
• @YuvalFilmus I have updated my post. Unfotunately I am not given many information in that task. I hope, my post is understandable now. – jublikon Jun 6 '17 at 12:48
• By "crosses a line" do you mean draws a line (with pen down) and later that line is touched by another line (also with pen down), or would you count it as a crossing if the turtle moved over a location it previously occupied? – Rick Decker Jun 6 '17 at 15:14
• By "crosses a line" do you mean draws a line (with pen down) and later that line is touched by another line (also with pen down) yes, it means that @RickDecker – jublikon Jun 6 '17 at 15:19

The program $g^nr^9gr^9g^mr^9gr^9g$ crosses a line iff $n \geq m$.
• Can you please explain why or where do you get $g^nr^9gr^9g^mr^9gr^9g$ from? – jublikon Aug 20 '17 at 9:57