Logo - Help the turtle escape the room

  • Context: MHB 
  • Thread starter Thread starter Yankel
  • Start date Start date
  • Tags Tags
    Escape
Click For Summary
SUMMARY

The discussion centers on the Logo programming language and the movement mechanics of a turtle within a defined circular area. The turtle is programmed to turn right by 135 degrees upon nearing the white background, preventing it from escaping the circle. It is established that the turtle can escape if it starts within a specific range from the center and is directed towards the exit at an angle of 135 degrees or less. If the turtle begins within a distance of 0.5√2 from the center, it cannot escape.

PREREQUISITES
  • Understanding of the Logo programming language
  • Knowledge of basic geometric principles
  • Familiarity with turtle graphics concepts
  • Ability to interpret angles and directional movement
NEXT STEPS
  • Explore advanced turtle graphics techniques in Logo
  • Research geometric transformations and their applications
  • Learn about programming logic for movement constraints
  • Investigate other programming languages that utilize turtle graphics
USEFUL FOR

This discussion is beneficial for educators, students learning programming concepts, and developers interested in graphical programming and geometric algorithms.

Yankel
Messages
390
Reaction score
0
Hello all,

I have a question, would like to have your opinion on the matter.

In the Logo programming language, I draw a red blue circle and put a turtle in it. I have specified that the turtle will move forward constantly, but, when approaching a white background (the page's background), it will turn right by 135 degrees. As a result, every time the turtle comes to exit the circle, it turns around and moved forward another way, staying in the circle. In this way the turtle never escapes the circle.

The question is: Is there a starting position (for the turtle itself and/or his head) that will allow him to escape?

Thank you !

View attachment 7237
 

Attachments

  • turtle.JPG
    turtle.JPG
    4.3 KB · Views: 120
Technology news on Phys.org
Yankel said:
Hello all,

I have a question, would like to have your opinion on the matter.

In the Logo programming language, I draw a red blue circle and put a turtle in it. I have specified that the turtle will move forward constantly, but, when approaching a white background (the page's background), it will turn right by 135 degrees. As a result, every time the turtle comes to exit the circle, it turns around and moved forward another way, staying in the circle. In this way the turtle never escapes the circle.

The question is: Is there a starting position (for the turtle itself and/or his head) that will allow him to escape?

Thank you !

Without loss of generality we can assume that the turtle escapes at the top.

\begin{tikzpicture}[>=stealth,shorten >=2pt,,shorten <=2pt]
\fill[cyan!50] circle (2);
\draw[help lines] (-3,-3) grid (3,3);
\draw circle (2);
\fill (0,2) circle (0.07);
\draw (2,0) -- (-1,3);
\draw[->, thick] (2,0) -- (0,2);
\draw[->, thick] (0,2) -- (2,2);
\draw[->] (0,2) +(62.5:0.7) node {$135^\circ$} +(135:1) arc (135:0:1);
\fill (0,0) circle (0.07);
\draw[<->] (0,0) -- node[below, xshift=4] {\small$\frac 12\sqrt 2$} (1,1);
\end{tikzpicture}

If the turtle starts somewhere on the first vector, or in the area that's above it, and moves to the top, it will escape.
And it's not possible to escape in 2 hits or more.

More generally, if the turtle is within distance $\frac 12 \sqrt 2$ of the center, it cannot escape.
And otherwise, it can escape, but only if it is directed at a point where the given angle is $135^\circ$ or less.
 

Similar threads

  • · Replies 30 ·
2
Replies
30
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 40 ·
2
Replies
40
Views
4K
Replies
3
Views
2K
  • · Replies 40 ·
2
Replies
40
Views
5K
Replies
3
Views
2K
  • · Replies 0 ·
Replies
0
Views
6K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K