The most complete Logo commands 2026

All the Logo commands below will help students easily perform operations when using this programming software. By mastering Logo commands, students will be able to perform tasks such as returning the turtle to its starting position or moving the turtle backward 100 steps faster.

All the Logo commands below will help students easily perform operations when using this programming software. By mastering Logo commands, students will be able to perform tasks such as returning the turtle to its starting position or moving the turtle backward 100 steps faster. This article summarizes all the basic Logo commands.

 

Some frequently asked questions

In Logo software, which command do I use to make the turtle return to its starting position?HOME

When executing the command, pdthe turtle will: Show itself , the command puwill hide itself .

In Logo software, which command do I use to make the turtle move backward 100 steps?bk 100

To clear the screen and make the turtle return to its starting position, I use the command: HOME

Logo movement commands

Command Acronym Function
Forward x FD x Move forward x steps
Back x BK x Step back x steps
Left x LT x Turn the turtle to the left at x degrees.
Right x RT x Turn the turtle to the right at x degrees.
ARC ar   Create a circle with angle 'a' and radius 'r'. After creating it, the turtle should stand still in place.
ARC2 ar   Create a circle with angle a and radius r. The turtle will follow along as you create it.
ELLIPSE xy   Create an ellipse with two parameters: width along the x-axis and height along the y-axis, with the turtle remaining stationary.
ELLIPSE2 xy   Create an ellipse with two parameters: width along the x-axis and height along the y-axis. The turtle will follow the ellipse.
ELLIPSEARC  

The length of the xyz arc (z is degrees)

For example, if you want to draw a half-ellipse in front of the turtle (90), the command is as follows: ELLIPSEARC 180 150 80 90.
You can change the number 90 to understand how to do it. If you want the turtle to run while drawing, use ELLIPSEARC2.

CIRCLE r   Draw a circle with radius r, with the turtle standing at the center.
CIRCLE2 r   Draw a circle with radius r. The turtle moves along the circle; after completion, the turtle lies on the circle.

 

The group of commands to print the results/message.

Command Acronym Function
SHOW [content of the results you want to print]   Similar PR order
LABEL   Results appear
Cleartext CT Clear the command window

Graphics and Color Command Group

Command Acronym Function
Penup PU The turtle was moved without leaving a trace.
Pendown PD The movement commands that follow this one will show traces of the movement.
  NCO Delete mode
SetPenSize n   Set the thickness of the pen stroke (n is the thickness of the pen stroke). This command can be executed via Menu Set → Pen Size…
SetPC [RBG]   Set the color for the brush. Values ​​range from 0-255.
Setfloodcolor [RGB] SETFC[RGB] Set the background color using Fill.
FILL   Color the background

The command group controls the turtle and its position.

Command Acronym Function
Hideturtle HT Hide the turtle
Showturtle ST The turtle
SETPOS xy   Move the turtle to position X,Y
SETX x   Move the turtle sideways x > 0 to the right, x
SETY y   Move the turtle up if y>0, down if y<0
Xcor   View the turtle's x-coordinate.
Yor   View the turtle's y-coordinate.
POS   View current location
CS   Delete and reposition
Clean   Erase the drawing, keeping the turtle in its original position.
HOME   The turtle returns to its original position.
HEADING   Turtle rotation
SetHeading   Spinning the turtle
TOWARDS xy   Turn the turtle's head towards the x and y coordinates.
DISTANCE xy   Distance from current position to coordinate xy

Instructions for programming using MSWLogo

Step 1: Move the turtle

The turtle's position will be displayed in the center. In the command input box, type Forward 50 and then click the Execute button to execute the command, or press Enter.

The turtle will immediately move 50 steps in a straight line. The abbreviation FD 50 can be entered.

If you want to move the turtle in a straight line to the right, enter the command RT 90 FD 50. The turtle will then rotate 90 degrees to the right and move forward 50 steps.

If you want to rotate the turtle to the left, enter the command LT 90 .

To type the reverse command, press BK 50 or Back .

If you want to clear all content displayed on the screen, type `clearscreen` or `CS` and move the turtle to the top.

 

To delete commands, press Cleartext or CT .

Picture 1 of The most complete Logo commands 2026

Step 2: Create a process for MSWLogo

The process in MSWLogo is a series of steps where the turtle will draw according to commands or the content you need to create.

To create a process for drawing a square, click on File , then type Square and press Enter. Click after the word Square and press Enter. Continue by typing the command FD 50 RT 90 four times . Then, click File, save and exit .

In the command line window, type the process Square > Execute . The turtle will then draw a square with dimensions of 50 x 50 x 50 x 50.

You continue by clicking Edall in the command line window and go to the process square you just created, then delete the command FD 50 RT 90 .

Repeat the above steps once more, but type a shorter command: [Repeat 4 FD 50 RT 90].

Click on File, save, and exit . Move to the command line window, type Square again, and press Enter. The turtle will draw a square on the screen.

Once you know how to draw a square, you can easily create other shapes. For example, to draw a triangle, enter the command Repeat 4 FD 50 RT 120 .

Picture 2 of The most complete Logo commands 2026

Step 3: Setxy coordinates

To move the turtle to different positions, type in the coordinates; the x-coordinate moves the turtle left and right, and the y-coordinate moves the turtle up and down.

For example, type the command Setxy 100 100 and press Enter to move the turtle 100 degrees left and right, and 100 degrees up and down.

 

Picture 3 of The most complete Logo commands 2026

Step 4: Penup and Pendown

Giao diện rùa lúc này như hình bút, bạn gõ lệnh Penup hoặc PU (viết tắt) và FD 50, nhấn Enter. Khi đó bút sẽ được nhấc lên và rùa di chuyển về phía trước 50 bước nhưng không vẽ gì.

Để đặt ngòi bút thì nhập lệnh Pendown hoặc PD.

Picture 4 of The most complete Logo commands 2026

Bước 5: Tạo một cửa sổ

Picture 5 of The most complete Logo commands 2026

Cửa sổ sẽ chứa các nút nguồn để chạy các quy trình. Nhấn File > Edit rồi đặt tên cho quy trình mới là Box và nhấn Enter. Tiếp tục gõ windowcreate "main "mywindow "Autodraw 0 0 50 50 [ ]. Trong đó:

  1. Autodraw là tên hiển thị của hình hộp, mywindows là tên MSW Logo sử dụng cho những hoạt động khác.
  2. 0 0 là tọa độ Setxy của hình hộp.
  3. 50 50 là kích thước hình hộp.

Tiếp tục gõ lệnh Box rồi nhấn Enter. Khi đó một cửa sổ nằm phía trên bên trái màn hình.

Tiếp tục click Edall > Enter sau (windowcreate "main "mywindow "Autodraw 0 0 50 50 [ ] ).

Khi đó bạn có thể tạo một số nút bấm chức năng. Đầu tiên click nút Reset trong cửa sổ lệnh để xóa box. Gõ lệnh buttoncreate "mywindow "mybutton "Square 10 20 30 10 [square]. Trong đó:

  1. Mywindows là tên cửa sổ chứa nút bấm.
  2. Mybutton là tên dùng cho tác vụ khác.
  3. Square là tên nút bấm.
  4. 10 20 là tọa độ Setxy
  5. 30 10 là kích thước nút.
  6. Dấu ngoặc quanh Square thông báo cho MSWLogo chạy quy trình tạo hình vuông khi click vào nút.

 

Gõ lệnh Box rồi nhấn Enter. Một cửa sổ được tạo có nút bấm.

Tiếp đến tạo nút đóng cửa sổ bằng cách tới box quy trình, rồi nhấn Enter sau dòng buttoncreate.

Gõ lệnh buttoncreate "mywindow "mybutton2 "Close 10 10 25 10 [windowdelete "mywindow]

Lệnh windowdelete sẽ xóa một cửa sổ nhưng bạn phải gõ 'mywindow" trước để thông báo cho phần mềm cửa sổ muốn xóa.

Giờ tới trình gõ lệnh, nhập box quy trình lần nữa và nhấn Enter. Chúng ta sẽ có một cửa sổ chứa nút vẽ hình vuông và đóng cửa sổ. Lúc này giao diện hiển thị như dưới đây.

Picture 6 of The most complete Logo commands 2026

Trên đây là toàn bộ lệnh logo sử dụng trong phần mềm MSWlogo, hi vọng sẽ hữu ích cho bạn.

Logo là phần mềm gì?

Logo là một ngôn ngữ lập trình giáo dục, được thiết kế vào năm 1967 bởi Daniel G. Bobrow, Wally Feurzeig, Seymour Papert và Cynthia Solomon. Ngày nay, ngôn ngữ này chủ yếu được nhớ đến với việc sử dụng "đồ họa con rùa" (Turtle Graphic), trong đó các lệnh chuyển động và vẽ đồ họa đường được tạo ra trên màn hình hoặc bằng một robot nhỏ được gọi là "con rùa". Đồ họa con rùa sử dụng hướng dẫn tập trung vào cơ thể, trong đó một đối tượng được di chuyển xung quanh màn hình bằng các lệnh, chẳng hạn như 'sang trái 90' và 'chuyển tiếp', chỉ định những hành động tương đối đến vị trí và hướng hiện tại của đối tượng thay vì trong khuôn khổ cố định. Cùng với những quy trình đệ quy, kỹ thuật này giúp bạn dễ dàng lập trình các mẫu phức tạp và hấp dẫn.

Ngôn ngữ này ban đầu được hình thành để dạy các khái niệm về lập trình liên quan đến LISP và Papert - gọi là "suy luận tổng hợp cơ thể", nơi học sinh có thể hiểu (và dự đoán và suy luận về) chuyển động của con rùa bằng cách tưởng tượng những gì chúng sẽ làm nếu chúng là con rùa đó.

Logo là sự thích ứng đa mô hình và phương ngữ của LISP, một ngôn ngữ lập trình chức năng. Không có Logo tiêu chuẩn, nhưng UCBLogo có các phương tiện tốt nhất để xử lý danh sách, file, I/O và đệ quy trong các tập lệnh, có thể được sử dụng để dạy tất cả các khái niệm khoa học máy tính, như giảng viên Brian Harvey của UC Berkeley đã làm trong bộ 3 tác phẩm Computer Science Logo Style. Tuy nhiên, đối với việc giảng dạy ở cấp độ đại học, Logo đã được thay thế bằng Scheme và các ngôn ngữ kịch bản (scripting language).

« PREV POST
READ NEXT »