logo-lang


How do I move the turtle in LOGO? [closed]


How do I move the turtle in LOGO?
// MOVE FORWARD
FD 75
// TURN RIGHT
RT 54
// TURN LEFT
LT 21
// MOVE BACKWARD
BK 17
Check out some other turtle commands found here...
Turtle Commands
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
Samples taken directly from website: http://gaza.freehosting.net/logo/index.html
Logo is all about moving the turtle... you give it commands like this:
Forward 100
Right 45
You can do stuff like repeating commands too:
Repeat 8 [Forward 100 Right 45] ; Draw an octagon
(What do I win? 8-)
Whoa! Is it still around?
fd 300 // Forward
rt 90 // Right 90°
fd 300
lt 90 // Left 90°
That used to work.
I've seen a few LOGO implementations where you can use localized commands like:
NAPRZOD (FORWARD),
LEWO (LEFT),
PRAWO (RIGTH)
or even NAPRZÓD (with Polish letter Ó).
LOGO is nice language to teach kids programming in their native spoken language.
By issuing commands in the correct syntax. E.G.:
forward 100
There is only one necessary command to move the turtle. It is forward which has the mnemonic fd. When working with a robot (real) turtle as opposed to a graphics based (virtual) one, you might find that the turning commands left and right [lt & rt] move the turtle a little, accidentally.
Most implementations also allow the command backwards [bk].
When the turtle moves, it may draw a line as it goes depending on whether the pen is up or down at the time, and whether the current pen color is different from the background color.
A graphics based (virtual) turtle can also jump around the screen with setx, sety, and setxy
try: bk(back), fd(forward), ld(left turn in degrees), rt(right turn).

Related Links

Working with lists in LOGO
Logo if statement
Return length of label, in pixels
How to catch command line arguments in Berkley Logo (UCBLogo)?
What are the drawbacks/weaknesses of using LOGO?
Which LOGO implementation? [closed]
How do I move the turtle in LOGO? [closed]
What is the current status of LOGO? (The programming language) [closed]

Categories

HOME
joomla
gulp
ssms
postgresql-9.3
display
microcontroller
stdout
ms-application-insights
sms
google-docs-api
sdk
powerquery
comments
meson-build
google-my-business-api
oms
kairosdb
osrm
drush
mbed
browsermob
reportlab
ringcentral
cucumberjs
draw2d
project-structure
scotty
openoffice-basic
gomobile
datazen-server
procedural-generation
deployment-descriptor
orgchart
angular2-changedetection
sphinx4
jbossfuse
openoffice-impress
selenium3
lines
ios-autolayout
ng2-bootstrap
outlook-2010
matrix-multiplication
latency
mybatis-generator
php-mongodb
togglebutton
stream-socket-client
hdpi
serialversionuid
runtime-permissions
riemann
seyren
senti-wordnet
cc
android-music-player
alfred
eclipse-mars
cosign-api
recurring
system-integration
angular-i18n
window.location
innertext
stdlist
firefox-os
apache2-module
recode
sdkman
updating
cyberduck
dpkt
screen-lock
veeam
chrome-mobile
google-experiments
alpha-beta-pruning
agent-based-modeling
mvcgrid
rails-migrations
vbaccelerator
myrrix
ia-32
infinity.js
azure-scheduler
uikit-dynamics
coinbase-php
biztalk-deployment
libx264
tasklist
mysql-connector
eeprom
joomla1.7
automapper-2
log-shipping
soapexception
gmagick
n2
meego-harmattan
hs-err
xslt-grouping
for-xml
retrospectiva

Resources

Encrypt Message