Location:
Search - haiguilo
Search list
Description: 编写类LOGO语言。
LOGO语言又称作海龟语言,由操作者通过一行命令来控制一个三角形的海龟移动,海龟的移动轨迹可以形成各种图案。
一行的命令可以包括多个子命令,按照从左到右的顺序执行,相关的命令有:
命令格式 命令范例 范例含义
前进 <长度> 前进 100 海龟前进100个点
后退 <长度> 后退 100 海龟后退100个点
左转 <角度> 左转 90 左转90度
右转 <角度> 右转 90 右转90度
抬起 抬起 海龟抬起画笔,不显示移动轨迹
放下 放下 海龟放下画笔,显示移动轨迹
隐藏 隐藏 隐藏海龟三角形
显示 显示 显示海龟三角形
重复 次数 (…) 重复 4 (前进 10 左转 90) 海龟画一个边长为10的正方形
清屏 清屏 海龟回到坐标原点,清除所有轨迹
提示,如果到达屏幕边缘继续前进,海龟将自动跳到屏幕的另一端。
本程序正是演示了这么一个功能。-LOGO language, also known as sea turtles language, through the line of command by the operator to control the movement of a triangle of sea turtles, sea turtles can form the trajectory of a variety of patterns.
The command line can include multiple sub-commands, executed in the order from left to right, the relevant commands are:
Example of the meaning of command format command example
Forward <length> turtle forward 100 forward 100 points
Back <length> back 100 back 100 points of sea turtles
Left <angle> 90 degrees left 90 left
Right <angle> 90 degrees right turn right 90
Lift lift lift the turtle pen, does not show the moving path
Put down his brush down turtle, showing the moving path
Hide Hide Hide triangle of sea turtles
Display Display Display turtle triangle
Repetitions (...) repeat 4 (forward 10 left 90) draw a turtle square of side length 10
Clear the screen clear screen turtle back to the origin of coordinates, remove all trace
Platform: |
Size: 45056 |
Author: 游志超 |
Hits: