Logo - Help the turtle escape the room

  • MHB
  • Thread starter Yankel
  • Start date
  • Tags
    Escape
In summary, in the Logo programming language, a turtle is placed inside a circle and constantly moves forward. When approaching a white background, the turtle turns right by 135 degrees, ensuring it never escapes the circle. However, if the turtle is placed within a certain distance from the center or directed towards a certain point, it can escape the circle.
  • #1
Yankel
395
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: 78
Technology news on Phys.org
  • #2
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.
 

FAQ: Logo - Help the turtle escape the room

What is "Logo - Help the turtle escape the room"?

"Logo - Help the turtle escape the room" is a puzzle game that challenges players to use coding skills to program a turtle to navigate through a room and reach the exit.

How do you play "Logo - Help the turtle escape the room"?

To play the game, players must use simple coding commands to move the turtle around the room. These commands include forward, backward, turn left, and turn right. The goal is to use these commands to guide the turtle to the exit without hitting any obstacles.

What skills does "Logo - Help the turtle escape the room" help develop?

This game helps develop coding and programming skills, as well as problem-solving and logical thinking skills. It also teaches players how to break down complex tasks into smaller, manageable steps.

Is "Logo - Help the turtle escape the room" suitable for all ages?

Yes, this game is suitable for all ages as it does not require any prior coding knowledge and can be played at different levels of difficulty.

Can "Logo - Help the turtle escape the room" be played on different devices?

Yes, the game can be played on various devices such as computers, tablets, and smartphones. It is available for both iOS and Android platforms.

Similar threads

Replies
5
Views
2K
Replies
1
Views
5K
Replies
8
Views
3K
Replies
1
Views
3K
Replies
1
Views
2K
Replies
4
Views
2K
Replies
1
Views
1K
Back
Top