Turtle examples for loops and variables, or even something else I'm going to teach using the well known drawing turtle, with one developed by me to fit my students, so in case it can also be modified. It features drawing movement, non-drawing movement and pen color change.

The main goal is letting them have a strong visual feedback and appreciate the decomposition of complex movements. I have some examples that use functions to represent "subtasks" and repetitions to generate nice drawings.

I'm anyway a bit stuck here, say at the visual artist stage, I'd like to show them the use of a while kind of loop instead of a statically limited for, but I don't have good ideas besides using the "while" condition to stop some recursion based for example on the next step length (imagine drawing a spiral with increasing step length and wanting to halt at some point).

It seems to me that my main difficulty has to do with the absence of interesting states from the examples, the only one that comes to mind being precisely the use of a step length.

The system also features 2 things.


A stack for saving turtle configurations, you can push the current position and pop it later... Fractals? It seems that those coming to my mind are more easily accessed by recursion than by a stack.
The ability to save a user state and access it, it can be used for example to keep a counter that changes when desired and is then used to choose a pen color from a palette. It can contain arbitrary data and the motivation was to use it as an aid for learning about mutating variables.


I anyway seem to not have good ideas for examples to link these tools to actual interesting problems. Any suggestions?

What can be easily computed by the turtle?
What your system is missing, actually, seems to be a feedback mechanism in which the turtle can "sense" something about the world it is in. If it, for example, could sense edge walls, then it could use that sense for conditional constructs. In Karel the Robot and its successors (Karel J Robot, Monty Karel, ...) there are a number of things that a robot can sense such as walls and "beepers". 

while (karel.frontIsClear())... 

If you can have multiple turtles then one turtle sensing something about another is another possibility for feedback. 

But, until you get something like that (sensing about the world) you can probably only write conditional and looping constructs based on stored information in the program itself, such as counters.