LOGO里的乌龟怎么移动?
当前回答
Logo是关于移动海龟的…你给它这样的命令:
Forward 100
Right 45
你也可以重复命令:
Repeat 8 [Forward 100 Right 45] ; Draw an octagon
(我能赢得什么?8 -)
其他回答
用正确的语法发出命令。例如:
forward 100
移动海龟只有一个必要的命令。有助记符fd的是forward。当使用机器人(真实的)海龟而不是基于图形的(虚拟的)海龟时,你可能会发现左右转动命令[lt & rt]会意外地移动海龟一点。
大多数实现也允许命令向后[bk]。
当乌龟移动时,它可能会根据钢笔当时是向上还是向下,以及当前钢笔的颜色是否与背景颜色不同,在移动时画一条线。
基于图形的(虚拟)海龟还可以使用setx、sety和setxy在屏幕上跳跃
哇!它还在吗?
fd 300 // Forward
rt 90 // Right 90°
fd 300
lt 90 // Left 90°
这在过去很管用。
Logo是关于移动海龟的…你给它这样的命令:
Forward 100
Right 45
你也可以重复命令:
Repeat 8 [Forward 100 Right 45] ; Draw an octagon
(我能赢得什么?8 -)
// MOVE FORWARD
FD 75
// TURN RIGHT
RT 54
// TURN LEFT
LT 21
// MOVE BACKWARD
BK 17
看看这里找到的其他一些turtle命令……
乌龟的命令
BACK ## [BK] - Move turtle back BACKGROUND ## [BG] - Set Background color (0-15) 0 - Black 1 - White 2 - Red 3 - Cyan 4 - Purple 5 - Green 6 - Blue 7 - Yellow 8 - Orange 9 - Brown 10 - Light Red 11 - Grey 1 12 - Grey 2 13 - Light Green 14 - Light Blue 15 - Grey 3 CLEARSCREEN [CS] - Clear Screen without moving turtle DRAW - Clear Screen and take turtle home EACH - Tell several sprites, whose numbers are in a list, to accept commands in a second list, e.g. EACH [1 2] [SQUARE 10] FORWARD ## [FD] - Move turtle forward FULLSCREEN - Full graphics screen (same as pressing F5) HEADING - Output turtle heading as a number (0-359) HIDETURTLE [HT] - Make turtle invisible HOME - Move turtle to center of screen pointing up LEFT [LT] - Turn turtle left NODRAW [ND] - Enter text mode with clear screen NOWRAP - Prevent drawings from wrapping around screen PENCOLOR [PC] - Change pen color PENDOWN [PD] - Turtle leaves trail PENUP [PU] - Turtle ceases to leave trail RIGHT ## [RT] - Turn turtle right SETHEADING [SETH] - Set turtle heading, e.g. SETH 180 SETSHAPE - Set the current sprite shape (0-7) SETX Move the turtle to the specified x co-ordinates e.g. SETX 50 SETXY Move the turtle to the specified x, y co-ordinates Eg. SETXY 50 50 SETY Move the turtle to the specified y co-ordinate, e.g. SETY 50 SHAPE - Output number of current sprite's shape SHOWTURTLE [ST] - Make turtle visible SPLITSCREEN - Mixed graphics and text screen (same as pressing F3) STAMPCHAR - Make the turtle stamp a character at the current location, e.g. STAMPCHAR "A TELL - Tell designated sprite to receive commands, e.g. TELL 2 TEXTSCREEN - Use whole screen for text (same as pressing F1) TOWARDS - Output heading for turtle to face an X,Y coordinate, e.g. TOWARDS 0 0 WRAP - Make turtle drawings wrap around the screen XCOR - Output current x co-ordinate of turtle YCOR - Output current y co-ordinate of turtle ASPECT - Set verticle screen scale factor, default is 0.76
样品直接取自网站:http://gaza.freehosting.net/logo/index.html
试试:bk(向后),fd(向前),ld(向左转弯),rt(向右转弯)。