/usr/local/poudriere/data/packages/e24a8cae34360705d022f17584bb6b4507b8eb89-build1/All/kturtle-4.14.3.txz vs.
/usr/local/poudriere/data/packages/e24a8cae34360705d022f17584bb6b4507b8eb89-build2/All/kturtle-4.14.3.txz
kturtle-4.14.3.txz-content
file list
Offset 4, 15 lines modifiedOffset 4, 15 lines modified
4 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​····​13182·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​appdata/​kturtle.​appdata.​xml4 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​····​13182·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​appdata/​kturtle.​appdata.​xml
5 -​rwxr-​xr-​x···​0·​root·········​(0)​·​wheel········​(0)​·····​4974·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​applications/​kde4/​kturtle.​desktop5 -​rwxr-​xr-​x···​0·​root·········​(0)​·​wheel········​(0)​·····​4974·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​applications/​kde4/​kturtle.​desktop
6 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​·····​2814·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​apps/​kturtle/​kturtleui.​rc6 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​·····​2814·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​apps/​kturtle/​kturtleui.​rc
7 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​······​121·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​config/​kturtle.​knsrc7 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​······​121·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​config/​kturtle.​knsrc
8 lrwxr-​xr-​x···​0·​root·········​(0)​·​wheel········​(0)​········​0·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​doc/​HTML/​en/​kturtle/​common·​-​>·​/​usr/​local/​share/​doc/​HTML/​en/​common8 lrwxr-​xr-​x···​0·​root·········​(0)​·​wheel········​(0)​········​0·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​doc/​HTML/​en/​kturtle/​common·​-​>·​/​usr/​local/​share/​doc/​HTML/​en/​common
9 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​·····​7805·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​doc/​HTML/​en/​kturtle/​getting-​started.​docbook9 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​·····​7805·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​doc/​HTML/​en/​kturtle/​getting-​started.​docbook
10 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​·····​8455·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​doc/​HTML/​en/​kturtle/​glossary.​docbook10 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​·····​8455·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​doc/​HTML/​en/​kturtle/​glossary.​docbook
11 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​····​21119·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​doc/​HTML/​en/​kturtle/​index.​cache.​bz211 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​····​21151·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​doc/​HTML/​en/​kturtle/​index.​cache.​bz2
12 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​·····​7618·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​doc/​HTML/​en/​kturtle/​index.​docbook12 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​·····​7618·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​doc/​HTML/​en/​kturtle/​index.​docbook
13 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​····​28830·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​doc/​HTML/​en/​kturtle/​mainwindow.​png13 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​····​28830·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​doc/​HTML/​en/​kturtle/​mainwindow.​png
14 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​····​54188·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​doc/​HTML/​en/​kturtle/​mainwindow_flower_nrs​.​png14 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​····​54188·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​doc/​HTML/​en/​kturtle/​mainwindow_flower_nrs​.​png
15 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​····​48768·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​doc/​HTML/​en/​kturtle/​programming-​reference.​docbook15 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​····​48768·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​doc/​HTML/​en/​kturtle/​programming-​reference.​docbook
16 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​·····​1026·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​doc/​HTML/​en/​kturtle/​translator-​guide.​docbook16 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​·····​1026·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​doc/​HTML/​en/​kturtle/​translator-​guide.​docbook
17 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​····​22937·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​doc/​HTML/​en/​kturtle/​using-​kturtle.​docbook17 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​····​22937·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​doc/​HTML/​en/​kturtle/​using-​kturtle.​docbook
18 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​·····​4099·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​icons/​hicolor/​128x128/​apps/​kturtle.​png18 -​rw-​r-​-​r-​-​···​0·​root·········​(0)​·​wheel········​(0)​·····​4099·​2016-​04-​21·​19:​48:​20.​000000·​/​usr/​local/​share/​icons/​hicolor/​128x128/​apps/​kturtle.​png
+COMPACT_MANIFEST
Offset 1, 1 lines modifiedOffset 1, 1 lines modified
1 {"name":​"kturtle",​"origin":​"lang/​kturtle",​"version":​"4.​14.​3",​"comment":​"Educational·​programming·​environment·​for·​KDE·​4",​"maintainer":​"kde@FreeBSD.​org",​"www":​"http:​/​/​edu.​kde.​org/​kturtle",​"abi":​"FreeBSD:​11:​amd64",​"arch":​"freebsd:​11:​x86:​64",​"prefix":​"/​usr/​local",​"flatsize":​791930,​"licenselogic":​"single",​"desc":​"KTurtle·​is·​an·​educational·​programming·​environment·​for·​KDE.​·​KTurtle\naims·​to·​make·​programming·​as·​easy·​and·​touchable·​as·​possible,​·​and\ntherefore·​can·​be·​used·​to·​teach·​kids·​the·​basics·​of·​math,​·​geometry\nand.​.​.​·​programming.​\n\nThe·​programming·​language·​used·​in·​KTurtle·​is·​loosely·​based·​on·​Logo.​\nKTurtle·​allows,​·​just·​like·​some·​implementations·​of·​Logo,​·​to·​translate\nthe·​programming·​language·​(the·​commands,​·​the·​documentation·​and·​the\nerror·​messages)​·​to·​the·​native·​language·​of·​the·​programmer.​·​Translating\nthe·​programming·​language·​to·​the·​native·​language·​of·​the·​programmer·​is\none·​of·​the·​many·​ways·​KTurtle·​tries·​to·​make·​learning·​to·​programming\nmore·​simple.​·​Other·​features·​to·​help·​to·​achieve·​this·​goal·​are:​\nintuitive·​syntax·​✂1 {"name":​"kturtle",​"origin":​"lang/​kturtle",​"version":​"4.​14.​3",​"comment":​"Educational·​programming·​environment·​for·​KDE·​4",​"maintainer":​"kde@FreeBSD.​org",​"www":​"http:​/​/​edu.​kde.​org/​kturtle",​"abi":​"FreeBSD:​11:​amd64",​"arch":​"freebsd:​11:​x86:​64",​"prefix":​"/​usr/​local",​"flatsize":​791962,​"licenselogic":​"single",​"desc":​"KTurtle·​is·​an·​educational·​programming·​environment·​for·​KDE.​·​KTurtle\naims·​to·​make·​programming·​as·​easy·​and·​touchable·​as·​possible,​·​and\ntherefore·​can·​be·​used·​to·​teach·​kids·​the·​basics·​of·​math,​·​geometry\nand.​.​.​·​programming.​\n\nThe·​programming·​language·​used·​in·​KTurtle·​is·​loosely·​based·​on·​Logo.​\nKTurtle·​allows,​·​just·​like·​some·​implementations·​of·​Logo,​·​to·​translate\nthe·​programming·​language·​(the·​commands,​·​the·​documentation·​and·​the\nerror·​messages)​·​to·​the·​native·​language·​of·​the·​programmer.​·​Translating\nthe·​programming·​language·​to·​the·​native·​language·​of·​the·​programmer·​is\none·​of·​the·​many·​ways·​KTurtle·​tries·​to·​make·​learning·​to·​programming\nmore·​simple.​·​Other·​features·​to·​help·​to·​achieve·​this·​goal·​are:​\nintuitive·​syntax·​✂
+MANIFEST
Offset 1, 1 lines modifiedOffset 1, 1 lines modified
1 {"name":​"kturtle",​"origin":​"lang/​kturtle",​"version":​"4.​14.​3",​"comment":​"Educational·​programming·​environment·​for·​KDE·​4",​"maintainer":​"kde@FreeBSD.​org",​"www":​"http:​/​/​edu.​kde.​org/​kturtle",​"abi":​"FreeBSD:​11:​amd64",​"arch":​"freebsd:​11:​x86:​64",​"prefix":​"/​usr/​local",​"flatsize":​791930,​"licenselogic":​"single",​"desc":​"KTurtle·​is·​an·​educational·​programming·​environment·​for·​KDE.​·​KTurtle\naims·​to·​make·​programming·​as·​easy·​and·​touchable·​as·​possible,​·​and\ntherefore·​can·​be·​used·​to·​teach·​kids·​the·​basics·​of·​math,​·​geometry\nand.​.​.​·​programming.​\n\nThe·​programming·​language·​used·​in·​KTurtle·​is·​loosely·​based·​on·​Logo.​\nKTurtle·​allows,​·​just·​like·​some·​implementations·​of·​Logo,​·​to·​translate\nthe·​programming·​language·​(the·​commands,​·​the·​documentation·​and·​the\nerror·​messages)​·​to·​the·​native·​language·​of·​the·​programmer.​·​Translating\nthe·​programming·​language·​to·​the·​native·​language·​of·​the·​programmer·​is\none·​of·​the·​many·​ways·​KTurtle·​tries·​to·​make·​learning·​to·​programming\nmore·​simple.​·​Other·​features·​to·​help·​to·​achieve·​this·​goal·​are:​\nintuitive·​syntax·​✂1 {"name":​"kturtle",​"origin":​"lang/​kturtle",​"version":​"4.​14.​3",​"comment":​"Educational·​programming·​environment·​for·​KDE·​4",​"maintainer":​"kde@FreeBSD.​org",​"www":​"http:​/​/​edu.​kde.​org/​kturtle",​"abi":​"FreeBSD:​11:​amd64",​"arch":​"freebsd:​11:​x86:​64",​"prefix":​"/​usr/​local",​"flatsize":​791962,​"licenselogic":​"single",​"desc":​"KTurtle·​is·​an·​educational·​programming·​environment·​for·​KDE.​·​KTurtle\naims·​to·​make·​programming·​as·​easy·​and·​touchable·​as·​possible,​·​and\ntherefore·​can·​be·​used·​to·​teach·​kids·​the·​basics·​of·​math,​·​geometry\nand.​.​.​·​programming.​\n\nThe·​programming·​language·​used·​in·​KTurtle·​is·​loosely·​based·​on·​Logo.​\nKTurtle·​allows,​·​just·​like·​some·​implementations·​of·​Logo,​·​to·​translate\nthe·​programming·​language·​(the·​commands,​·​the·​documentation·​and·​the\nerror·​messages)​·​to·​the·​native·​language·​of·​the·​programmer.​·​Translating\nthe·​programming·​language·​to·​the·​native·​language·​of·​the·​programmer·​is\none·​of·​the·​many·​ways·​KTurtle·​tries·​to·​make·​learning·​to·​programming\nmore·​simple.​·​Other·​features·​to·​help·​to·​achieve·​this·​goal·​are:​\nintuitive·​syntax·​✂
/usr/local/share/doc/HTML/en/kturtle/index.cache.bz2
index.cache
Offset 1, 8 lines modifiedOffset 1, 8 lines modified
1 <FILENAME·​filename="index.​html"><html><head><ti​tle>The·​KTurtle·​Handbook</​title><link·​rel="stylesheet"·​type="text/​css"·​href="help:​/​common/​kde-​default.​css"><link·​rel="stylesheet"·​type="text/​css"·​href="help:​/​common/​kde-​docs.​css"><link·​rel="stylesheet"·​type="text/​css"·​href="help:​/​common/​kde-​localised.​css"><meta·​name="generator"·​content="DocBook·​XSL·​Stylesheets·​V1.​76.​1"><meta·​name="description"·​content="KTurtle·​is·​an·​educational·​programming·​environment·​that·​aims·​to·​make·​learning·​how·​to·​program·​as·​easy·​as·​possible.​·​To·​achieve·​this·​KTurtle·​makes·​all·​programming·​tools·​available·​from·​the·​user·​interface.​·​The·​programming·​language·​used·​is·​TurtleScript·​which·​allows·​its·​commands·​to·​be·​translated.​"><meta·​name="keywords"·​content="KDE,​·​kdeedu,​·​KTurtle,​·​education,​·​language,​·​native,​·​programming,​·​TurtleScript,​·​Logo,​·​turtle"><link·​rel="home"·​href="index.​html"·​title="The·​KTurtle·​Handbook"><link·​rel="next"·​href="introduction.​html"·​title="Chapter 1.​ Introduction"><meta·​http-​equiv="Content-​Type"·​content="text/​html;​·​charset=utf-​8"><me·​✂1 <FILENAME·​filename="index.​html"><html><head><ti​tle>The·​KTurtle·​Handbook</​title><link·​rel="stylesheet"·​type="text/​css"·​href="help:​/​common/​kde-​default.​css"><link·​rel="stylesheet"·​type="text/​css"·​href="help:​/​common/​kde-​docs.​css"><link·​rel="stylesheet"·​type="text/​css"·​href="help:​/​common/​kde-​localised.​css"><meta·​name="generator"·​content="DocBook·​XSL·​Stylesheets·​V1.​76.​1"><meta·​name="description"·​content="KTurtle·​is·​an·​educational·​programming·​environment·​that·​aims·​to·​make·​learning·​how·​to·​program·​as·​easy·​as·​possible.​·​To·​achieve·​this·​KTurtle·​makes·​all·​programming·​tools·​available·​from·​the·​user·​interface.​·​The·​programming·​language·​used·​is·​TurtleScript·​which·​allows·​its·​commands·​to·​be·​translated.​"><meta·​name="keywords"·​content="KDE,​·​kdeedu,​·​KTurtle,​·​education,​·​language,​·​native,​·​programming,​·​TurtleScript,​·​Logo,​·​turtle"><link·​rel="home"·​href="index.​html"·​title="The·​KTurtle·​Handbook"><link·​rel="next"·​href="introduction.​html"·​title="Chapter 1.​ Introduction"><meta·​http-​equiv="Content-​Type"·​content="text/​html;​·​charset=utf-​8"><me·​✂
2 a·​programming·​language·​loosely·​based·​on·​and·​inspired·​by·​Logo.​·​The·​goal·​of·​<span·​class="application">K​Turtle</​span>·​is·​to·​make·​programming·​as·​easy·​and·​accessible·​as·​possible.​·​This·​makes·​<span·​class="application">K​Turtle</​span>·​suitable·​for·​teaching·​kids·​the·​basics·​of·​math,​·​geometry·​and.​.​.​2 a·​programming·​language·​loosely·​based·​on·​and·​inspired·​by·​Logo.​·​The·​goal·​of·​<span·​class="application">K​Turtle</​span>·​is·​to·​make·​programming·​as·​easy·​and·​accessible·​as·​possible.​·​This·​makes·​<span·​class="application">K​Turtle</​span>·​suitable·​for·​teaching·​kids·​the·​basics·​of·​math,​·​geometry·​and.​.​.​
3 programming.​·​One·​of·​the·​main·​features·​of·​TurtleScript·​is·​the·​ability·​to·​translate·​the·​commands·​into·​the·​speaking·​language·​of·​the·​programmer.​</​p><p><span·​class="application">K​Turtle</​span>·​is·​named·​after·​<span·​class="quote">“<span·​class="quote">the·​turtle</​span>”</​span>·​that·​plays·​a·​central·​role·​in·​the·​programming·​environment.​·​The·​student·​will·​usually·​instruct·​the·​turtle,​·​using·​the·​TurtleScript·​commands,​·​to·​make·​a·​drawing·​on·​<a·​class="link"·​href="the-​canvas.​html"·​title="The·​Canvas">the·​canvas</​a>.​</​p><div·​class="sect1"><div·​class="titlepage"><di​v><div><h2·​class="title"·​style="clear:​·​both"><a·​name="what-​is-​turtlelang"></​a>What·​is·​TurtleScript?</​h2></​div></​div></​div><p>TurtleScript,​·​the·​programming·​language·​used·​in·​<span·​class="application">K​Turtle</​span>,​·​is·​inspired·​by·​the·​Logo·​family·​of·​programming·​languages.​·​The·​first·​version·​of·​Logo·​was·​created·​by·​Seymour·​Papert·​of·​MIT·​Artificial·​Intelligence·​Laboratory·​in·​1967·​as·​an·​offshoot·​of·​the·​LISP·​programming·​language.​·​From·​then·​many·​versions·​of·​Logo·​have·​been·​releas·​✂3 programming.​·​One·​of·​the·​main·​features·​of·​TurtleScript·​is·​the·​ability·​to·​translate·​the·​commands·​into·​the·​speaking·​language·​of·​the·​programmer.​</​p><p><span·​class="application">K​Turtle</​span>·​is·​named·​after·​<span·​class="quote">“<span·​class="quote">the·​turtle</​span>”</​span>·​that·​plays·​a·​central·​role·​in·​the·​programming·​environment.​·​The·​student·​will·​usually·​instruct·​the·​turtle,​·​using·​the·​TurtleScript·​commands,​·​to·​make·​a·​drawing·​on·​<a·​class="link"·​href="the-​canvas.​html"·​title="The·​Canvas">the·​canvas</​a>.​</​p><div·​class="sect1"><div·​class="titlepage"><di​v><div><h2·​class="title"·​style="clear:​·​both"><a·​name="what-​is-​turtlelang"></​a>What·​is·​TurtleScript?</​h2></​div></​div></​div><p>TurtleScript,​·​the·​programming·​language·​used·​in·​<span·​class="application">K​Turtle</​span>,​·​is·​inspired·​by·​the·​Logo·​family·​of·​programming·​languages.​·​The·​first·​version·​of·​Logo·​was·​created·​by·​Seymour·​Papert·​of·​MIT·​Artificial·​Intelligence·​Laboratory·​in·​1967·​as·​an·​offshoot·​of·​the·​LISP·​programming·​language.​·​From·​then·​many·​versions·​of·​Logo·​have·​been·​releas·​✂
4 purposes.​·​The·​MIT·​is·​still·​maintains·​<a·​class="ulink"·​href="http:​/​/​el.​media.​mit.​edu/​logo-​foundation/​"·​target="_top">a·​website·​on·​Logo</​a>·​containing·​a·​list·​of·​several·​popular·​implementation·​of·​the·​language.​</​p><p>TurtleScript·​shares·​a·​feature·​found·​in·​many·​other·​implementations·​of·​Logo:​·​the·​ability·​to·​translate·​the·​commands·​to·​suit·​the·​native·​language·​of·​the·​student.​·​This·​feature·​makes·​it·​easier·​for·​students·​that·​have·​no·​or·​little·​understanding·​of·​English·​to·​get·​started.​·​Besides·​this·​feature·​<span·​class="application">K​Turtle</​span>·​has·​<a·​class="link"·​href="features-​of-​kturtle.​html"·​title="Features·​of·​KTurtle">many·​other·​features</​a>·​aimed·​at·​easing·​the·​students·​initial·​experience·​with·​programming.​</​p></​div><FILENAME·​filename="features-​of-​kturtle.​html"><html><head><ti​tle>Features·​of·​KTurtle</​title><link·​rel="stylesheet"·​type="text/​css"·​href="help:​/​common/​kde-​default.​css"><link·​rel="stylesheet"·​type="text/​css"·​href="help:​/​common/​kde-​docs.​css"><link·​rel="stylesheet"·​type="text/​css"·​href="help:​/​common/​kde-​locali·​✂4 purposes.​·​The·​MIT·​is·​still·​maintains·​<a·​class="ulink"·​href="http:​/​/​el.​media.​mit.​edu/​logo-​foundation/​"·​target="_top">a·​website·​on·​Logo</​a>·​containing·​a·​list·​of·​several·​popular·​implementation·​of·​the·​language.​</​p><p>TurtleScript·​shares·​a·​feature·​found·​in·​many·​other·​implementations·​of·​Logo:​·​the·​ability·​to·​translate·​the·​commands·​to·​suit·​the·​native·​language·​of·​the·​student.​·​This·​feature·​makes·​it·​easier·​for·​students·​that·​have·​no·​or·​little·​understanding·​of·​English·​to·​get·​started.​·​Besides·​this·​feature·​<span·​class="application">K​Turtle</​span>·​has·​<a·​class="link"·​href="features-​of-​kturtle.​html"·​title="Features·​of·​KTurtle">many·​other·​features</​a>·​aimed·​at·​easing·​the·​students·​initial·​experience·​with·​programming.​</​p></​div><FILENAME·​filename="features-​of-​kturtle.​html"><html><head><ti​tle>Features·​of·​KTurtle</​title><link·​rel="stylesheet"·​type="text/​css"·​href="help:​/​common/​kde-​default.​css"><link·​rel="stylesheet"·​type="text/​css"·​href="help:​/​common/​kde-​docs.​css"><link·​rel="stylesheet"·​type="text/​css"·​href="help:​/​common/​kde-​locali·​✂
5 </​p><div·​class="itemizedlist">​<ul·​class="itemizedlist"·​type="disc"><li·​class="listitem"><p>A​n·​integrated·​environment·​with·​TurtleScript·​interpreter,​·​<a·​class="link"·​href="using-​kturtle.​html#the-​editor"·​title="The·​Editor">editor</​a>,​·​<a·​class="link"·​href="the-​canvas.​html"·​title="The·​Canvas">canvas</​a>·​and·​other·​tools·​all·​in·​one·​application·​(no·​extra·​dependencies)​.​</​p></​li><li·​class="listitem"><p>T​he·​ability·​to·​translate·​the·​TurtleScript·​commands·​using·​the·​translation·​framework·​of·​<acronym·​class="acronym">KDE</​acronym>.​</​p></​li><li·​class="listitem"><p>T​urtleScript·​supports·​user·​defined·​functions,​·​recursion·​and·​dynamic·​type·​switching.​</​p></​li><li·​class="listitem"><p>T​he·​execution·​can·​be·​slowed·​down,​·​paused·​or·​stopped·​at·​any·​time.​</​p></​li><li·​class="listitem"><p>A​·​powerful·​<a·​class="link"·​href="using-​kturtle.​html#the-​editor"·​title="The·​Editor">editor</​a>·​featuring·​intuitive·​syntax·​highlighting,​·​line·​numbering,​·​error·​markers,​·​visual·​execution·​and·​more.​</​p></​li><li·​class="listitem"><p>T​he·​<a·​class="link"·​href="the-​c·​✂5 </​p><div·​class="itemizedlist">​<ul·​class="itemizedlist"·​type="disc"><li·​class="listitem"><p>A​n·​integrated·​environment·​with·​TurtleScript·​interpreter,​·​<a·​class="link"·​href="using-​kturtle.​html#the-​editor"·​title="The·​Editor">editor</​a>,​·​<a·​class="link"·​href="the-​canvas.​html"·​title="The·​Canvas">canvas</​a>·​and·​other·​tools·​all·​in·​one·​application·​(no·​extra·​dependencies)​.​</​p></​li><li·​class="listitem"><p>T​he·​ability·​to·​translate·​the·​TurtleScript·​commands·​using·​the·​translation·​framework·​of·​<acronym·​class="acronym">KDE</​acronym>.​</​p></​li><li·​class="listitem"><p>T​urtleScript·​supports·​user·​defined·​functions,​·​recursion·​and·​dynamic·​type·​switching.​</​p></​li><li·​class="listitem"><p>T​he·​execution·​can·​be·​slowed·​down,​·​paused·​or·​stopped·​at·​any·​time.​</​p></​li><li·​class="listitem"><p>A​·​powerful·​<a·​class="link"·​href="using-​kturtle.​html#the-​editor"·​title="The·​Editor">editor</​a>·​featuring·​intuitive·​syntax·​highlighting,​·​line·​numbering,​·​error·​markers,​·​visual·​execution·​and·​more.​</​p></​li><li·​class="listitem"><p>T​he·​<a·​class="link"·​href="the-​c·​✂
6 </​p></​div></​div><div·​id="footer"><div·​class="navCenter"><ta​ble·​class="navigation"><t​r><td·​class="prevCell"><a·​accesskey="p"·​href="introduction.​html">Prev</​a></​td><td·​class="upCell"><a·​accesskey="h"·​href="index.​html">Contents</​a></​td><td·​class="nextCell"><a·​accesskey="n"·​href="using-​kturtle.​html">Next</​a></​td></​tr><tr><td·​class="prevCell">Intr​oduction </​td><td·​class="upCell">Introd​uction</​td><td·​class="nextCell"> Usi​ng·​<span·​class="application">K​Turtle</​span></​td></​tr></​table></​div><div·​id="footer_text">Woul​d·​you·​like·​to·​make·​a·​comment·​or·​contribute·​an·​update·​to·​this·​page?<br>Send·​feedback·​to·​the·​<a·​href="mailto:​kde-​doc-​english@kde.​org"·​class="footer_email">​KDE·​Docs·​Team</​a></​div></​div></​div></​body></​html></​FILENAME></​div></​div><div·​id="footer"><div·​class="navCenter"><ta​ble·​class="navigation"><t​r><td·​class="prevCell"><a·​accesskey="p"·​href="index.​html">Prev</​a></​td><td·​class="upCell"><a·​accesskey="h"·​href="index.​html">Contents</​a></​td><td·​class="nextCell"><a·​accesskey="n"·​href="features-​of-​kturtle.​html">Next</​a·​✂6 </​p></​div></​div><div·​id="footer"><div·​class="navCenter"><ta​ble·​class="navigation"><t​r><td·​class="prevCell"><a·​accesskey="p"·​href="introduction.​html">Prev</​a></​td><td·​class="upCell"><a·​accesskey="h"·​href="index.​html">Contents</​a></​td><td·​class="nextCell"><a·​accesskey="n"·​href="using-​kturtle.​html">Next</​a></​td></​tr><tr><td·​class="prevCell">Intr​oduction </​td><td·​class="upCell">Introd​uction</​td><td·​class="nextCell"> Usi​ng·​<span·​class="application">K​Turtle</​span></​td></​tr></​table></​div><div·​id="footer_text">Woul​d·​you·​like·​to·​make·​a·​comment·​or·​contribute·​an·​update·​to·​this·​page?<br>Send·​feedback·​to·​the·​<a·​href="mailto:​kde-​doc-​english@kde.​org"·​class="footer_email">​KDE·​Docs·​Team</​a></​div></​div></​div></​body></​html></​FILENAME></​div></​div><div·​id="footer"><div·​class="navCenter"><ta​ble·​class="navigation"><t​r><td·​class="prevCell"><a·​accesskey="p"·​href="index.​html">Prev</​a></​td><td·​class="upCell"><a·​accesskey="h"·​href="index.​html">Contents</​a></​td><td·​class="nextCell"><a·​accesskey="n"·​href="features-​of-​kturtle.​html">Next</​a·​✂
7 ······​additional·​TurtleScript·​files·​from·​the·​Internet.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="file-​save"></​a><dl><dt><span·​class="term"><span·​xmlns:​doc="http:​/​/​nwalsh.​com/​xsl/​documentation/​1.​0"·​class="guiitem"><span​·​class="guimenu">File<​/​span></​span>·​→·​<span·​xmlns:​doc="http:​/​/​nwalsh.​com/​xsl/​documentation/​1.​0"·​class="guiitem"><span​·​class="guimenuitem">S​ave</​span></​span>·​(<span·​class="shortcut"><str​ong><span·​class="keycap"><stron​g>Ctrl</​strong></​span>+<span·​class="keycap"><stron​g>S</​strong></​span></​strong></​span>)​</​span></​dt><dd><p>Saves·​the·​currently·​opened·​TurtleScript·​file.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="file-​save-​as"></​a><dl><dt><span·​class="term"><span·​xmlns:​doc="http:​/​/​nwalsh.​com/​xsl/​documentation/​1.​0"·​class="guiitem"><span​·​class="guimenu">File<​/​span></​span>·​→·​<span·​xmlns:​doc="http:​/​/​nwalsh.​com/​xsl/​documentation/​1.​0"·​class="guiitem"><span​·​class="guimenuitem">S​ave·​As.​.​.​</​span></​span></​span></​dt><dd><p>Saves·​the·​currently·​opened·​TurtleScript·​file·​on·​a·​specified·​location·​✂7 ······​additional·​TurtleScript·​files·​from·​the·​Internet.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="file-​save"></​a><dl><dt><span·​class="term"><span·​xmlns:​doc="http:​/​/​nwalsh.​com/​xsl/​documentation/​1.​0"·​class="guiitem"><span​·​class="guimenu">File<​/​span></​span>·​→·​<span·​xmlns:​doc="http:​/​/​nwalsh.​com/​xsl/​documentation/​1.​0"·​class="guiitem"><span​·​class="guimenuitem">S​ave</​span></​span>·​(<span·​class="shortcut"><str​ong><span·​class="keycap"><stron​g>Ctrl</​strong></​span>+<span·​class="keycap"><stron​g>S</​strong></​span></​strong></​span>)​</​span></​dt><dd><p>Saves·​the·​currently·​opened·​TurtleScript·​file.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="file-​save-​as"></​a><dl><dt><span·​class="term"><span·​xmlns:​doc="http:​/​/​nwalsh.​com/​xsl/​documentation/​1.​0"·​class="guiitem"><span​·​class="guimenu">File<​/​span></​span>·​→·​<span·​xmlns:​doc="http:​/​/​nwalsh.​com/​xsl/​documentation/​1.​0"·​class="guiitem"><span​·​class="guimenuitem">S​ave·​As.​.​.​</​span></​span></​span></​dt><dd><p>Saves·​the·​currently·​opened·​TurtleScript·​file·​on·​a·​specified·​location·​✂
8 <span·​xmlns:​doc="http:​/​/​nwalsh.​com/​xsl/​documentation/​1.​0"·​class="guiitem"><span​·​class="guimenu">Help<​/​span></​span>·​→·​<span·​xmlns:​doc="http:​/​/​nwalsh.​com/​xsl/​documentation/​1.​0"·​class="guiitem"><span​·​class="guimenuitem"><​span·​class="application">K​Turtle</​span>·​Handbook</​span></​span>·​(<span·​class="shortcut"><str​ong><span·​class="keycap"><stron​g>F1</​strong></​span></​strong></​span>)​8 <span·​xmlns:​doc="http:​/​/​nwalsh.​com/​xsl/​documentation/​1.​0"·​class="guiitem"><span​·​class="guimenu">Help<​/​span></​span>·​→·​<span·​xmlns:​doc="http:​/​/​nwalsh.​com/​xsl/​documentation/​1.​0"·​class="guiitem"><span​·​class="guimenuitem"><​span·​class="application">K​Turtle</​span>·​Handbook</​span></​span>·​(<span·​class="shortcut"><str​ong><span·​class="keycap"><stron​g>F1</​strong></​span></​strong></​span>)​
Offset 134, 82 lines modifiedOffset 134, 82 lines modified
134 }134 }
135 </​pre></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="comparing-​operators"></​a>Comparing·​operators</​h3></​div></​div></​div><p>Consider·​this·​simple·​comparison:​135 </​pre></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="comparing-​operators"></​a>Comparing·​operators</​h3></​div></​div></​div><p>Consider·​this·​simple·​comparison:​
136 </​p><pre·​class="screen">136 </​p><pre·​class="screen">
137 $answer·​=·​10·​&gt;​·​3137 $answer·​=·​10·​&gt;​·​3
138 </​pre><p>138 </​pre><p>
139 Here·​<strong·​class="userinput"><co​de>10</​code></​strong>·​is·​compared·​to·​<strong·​class="userinput"><co​de>3</​code></​strong>·​with·​the·​'greater·​than'·​operator.​·​The·​result·​of·​this·​comparison,​·​the·​<a·​class="link"·​href="reference.​html#boolean-​value"·​title="Boolean·​(true/​false)​·​values">boolean·​value</​a>·​<strong·​class="userinput"><co​de>true</​code></​strong>·​is·​stored·​in·​the·​<a·​class="link"·​href="assignment-​of-​variables.​html"·​title="Assignment·​of·​variables">variable</​a>·​<strong·​class="userinput"><co​de>$answer</​code></​strong>.​</​p><p>All·​<a·​class="link"·​href="reference.​html#number"·​title="Numbers">numbe​rs</​a>·​and·​<a·​class="link"·​href="assignment-​of-​variables.​html"·​title="Assignment·​of·​variables">variables<​/​a>·​(that·​contain·​numbers)​·​can·​be·​compared·​to·​each·​other·​with·​comparing·​operators.​</​p><p>139 Here·​<strong·​class="userinput"><co​de>10</​code></​strong>·​is·​compared·​to·​<strong·​class="userinput"><co​de>3</​code></​strong>·​with·​the·​'greater·​than'·​operator.​·​The·​result·​of·​this·​comparison,​·​the·​<a·​class="link"·​href="reference.​html#boolean-​value"·​title="Boolean·​(true/​false)​·​values">boolean·​value</​a>·​<strong·​class="userinput"><co​de>true</​code></​strong>·​is·​stored·​in·​the·​<a·​class="link"·​href="assignment-​of-​variables.​html"·​title="Assignment·​of·​variables">variable</​a>·​<strong·​class="userinput"><co​de>$answer</​code></​strong>.​</​p><p>All·​<a·​class="link"·​href="reference.​html#number"·​title="Numbers">numbe​rs</​a>·​and·​<a·​class="link"·​href="assignment-​of-​variables.​html"·​title="Assignment·​of·​variables">variables<​/​a>·​(that·​contain·​numbers)​·​can·​be·​compared·​to·​each·​other·​with·​comparing·​operators.​</​p><p>
140 Here·​are·​all·​possible·​comparing·​operators:​140 Here·​are·​all·​possible·​comparing·​operators:​
141 </​p><div·​class="table"><a·​name="idp149455928"><​/​a><p·​class="title"><b>Tabl​e 4.​1.​ Types·​of·​questions</​b></​p><div·​class="table-​contents"><table·​summary="Types·​of·​questions"·​border="1"><colgroup>​<col><col><col></​colgroup><tbody><tr><​td><strong·​class="userinput"><co​de>$A·​==·​$B</​code></​strong></​td><td>equals</​td><td>answer·​is·​<span·​class="quote">“<span·​class="quote">true</​span>”</​span>·​if·​<strong·​class="userinput"><co​de>$A</​code></​strong>·​equals·​<strong·​class="userinput"><co​de>$B</​code></​strong></​td></​tr><tr><td><strong·​class="userinput"><co​de>$A·​!=·​$B</​code></​strong></​td><td>not-​equals</​td><td>answer·​is·​<span·​class="quote">“<span·​class="quote">true</​span>”</​span>·​if·​<strong·​class="userinput"><co​de>$A</​code></​strong>·​does·​not·​equal·​<strong·​class="userinput"><co​de>$B</​code></​strong></​td></​tr><tr><td><strong·​class="userinput"><co​de>$A·​&gt;​·​$B</​code></​strong></​td><td>greater·​than</​td><td>answer·​is·​<span·​class="quote">“<span·​class="quote">true</​span>”</​span>·​if·​<strong·​class="userinput"><co​de>$A</​code></​strong>·​is·​gre·​✂141 </​p><div·​class="table"><a·​name="idp149435448"><​/​a><p·​class="title"><b>Tabl​e 4.​1.​ Types·​of·​questions</​b></​p><div·​class="table-​contents"><table·​summary="Types·​of·​questions"·​border="1"><colgroup>​<col><col><col></​colgroup><tbody><tr><​td><strong·​class="userinput"><co​de>$A·​==·​$B</​code></​strong></​td><td>equals</​td><td>answer·​is·​<span·​class="quote">“<span·​class="quote">true</​span>”</​span>·​if·​<strong·​class="userinput"><co​de>$A</​code></​strong>·​equals·​<strong·​class="userinput"><co​de>$B</​code></​strong></​td></​tr><tr><td><strong·​class="userinput"><co​de>$A·​!=·​$B</​code></​strong></​td><td>not-​equals</​td><td>answer·​is·​<span·​class="quote">“<span·​class="quote">true</​span>”</​span>·​if·​<strong·​class="userinput"><co​de>$A</​code></​strong>·​does·​not·​equal·​<strong·​class="userinput"><co​de>$B</​code></​strong></​td></​tr><tr><td><strong·​class="userinput"><co​de>$A·​&gt;​·​$B</​code></​strong></​td><td>greater·​than</​td><td>answer·​is·​<span·​class="quote">“<span·​class="quote">true</​span>”</​span>·​if·​<strong·​class="userinput"><co​de>$A</​code></​strong>·​is·​gre·​✂
142 Please·​note·​that·​$A·​and·​$B·​have·​to·​be·​<a·​class="link"·​href="reference.​html#number"·​title="Numbers">numbe​rs</​a>·​or·​<a·​class="link"·​href="assignment-​of-​variables.​html"·​title="Assignment·​of·​variables">variables<​/​a>·​that·​contain·​numbers.​</​p></​div></​div></​div><div·​id="footer"><div·​class="navCenter"><ta​ble·​class="navigation"><t​r><td·​class="prevCell"><a·​accesskey="p"·​href="reference.​html">Prev</​a></​td><td·​class="upCell"><a·​accesskey="h"·​href="index.​html">Contents</​a></​td><td·​class="nextCell"><a·​accesskey="n"·​href="commands.​html">Next</​a></​td></​tr><tr><td·​class="prevCell">Turt​leScript·​Programming·​Reference </​td><td·​class="upCell">Turtle​Script·​Programming·​Reference</​td><td·​class="nextCell"> Com​mands</​td></​tr></​table></​div><div·​id="footer_text">Woul​d·​you·​like·​to·​make·​a·​comment·​or·​contribute·​an·​update·​to·​this·​page?<br>Send·​feedback·​to·​the·​<a·​href="mailto:​kde-​doc-​english@kde.​org"·​class="footer_email">​KDE·​Docs·​Team</​a></​div></​div></​div></​body></​html></​FILENAME><FILENAME·​filename="commands.​html"><html><head><ti​tle>Commands·​✂142 Please·​note·​that·​$A·​and·​$B·​have·​to·​be·​<a·​class="link"·​href="reference.​html#number"·​title="Numbers">numbe​rs</​a>·​or·​<a·​class="link"·​href="assignment-​of-​variables.​html"·​title="Assignment·​of·​variables">variables<​/​a>·​that·​contain·​numbers.​</​p></​div></​div></​div><div·​id="footer"><div·​class="navCenter"><ta​ble·​class="navigation"><t​r><td·​class="prevCell"><a·​accesskey="p"·​href="reference.​html">Prev</​a></​td><td·​class="upCell"><a·​accesskey="h"·​href="index.​html">Contents</​a></​td><td·​class="nextCell"><a·​accesskey="n"·​href="commands.​html">Next</​a></​td></​tr><tr><td·​class="prevCell">Turt​leScript·​Programming·​Reference </​td><td·​class="upCell">Turtle​Script·​Programming·​Reference</​td><td·​class="nextCell"> Com​mands</​td></​tr></​table></​div><div·​id="footer_text">Woul​d·​you·​like·​to·​make·​a·​comment·​or·​contribute·​an·​update·​to·​this·​page?<br>Send·​feedback·​to·​the·​<a·​href="mailto:​kde-​doc-​english@kde.​org"·​class="footer_email">​KDE·​Docs·​Team</​a></​div></​div></​div></​body></​html></​FILENAME><FILENAME·​filename="commands.​html"><html><head><ti​tle>Commands·​✂
143 ······​<strong·​class="userinput"><co​de>forward</​code></​strong>·​moves·​the·​turtle·​forward·​by·​the·​amount·​of·​X·​pixels.​·​When·​the·​pen·​is·​down·​the·​turtle·​will·​leave·​a·​trail.​·​<strong·​class="userinput"><co​de>forward</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>fw</​code></​strong></​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="backward"></​a><dl><dt><span·​class="term">backward​·​(bw)​<a·​class="indexterm"·​name="idp149484088"><​/​a></​span></​dt><dd><pre·​class="screen">backwa​rd·​X</​pre><p>143 ······​<strong·​class="userinput"><co​de>forward</​code></​strong>·​moves·​the·​turtle·​forward·​by·​the·​amount·​of·​X·​pixels.​·​When·​the·​pen·​is·​down·​the·​turtle·​will·​leave·​a·​trail.​·​<strong·​class="userinput"><co​de>forward</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>fw</​code></​strong></​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="backward"></​a><dl><dt><span·​class="term">backward​·​(bw)​<a·​class="indexterm"·​name="idp149463608"><​/​a></​span></​dt><dd><pre·​class="screen">backwa​rd·​X</​pre><p>
144 ······​<strong·​class="userinput"><co​de>backward</​code></​strong>·​moves·​the·​turtle·​backward·​by·​the·​amount·​of·​X·​pixels.​·​When·​the·​pen·​is·​down·​the·​turtle·​will·​leave·​a·​trail.​·​<strong·​class="userinput"><co​de>backward</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>bw</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="turnleft"></​a><dl><dt><span·​class="term">turnleft​·​(tl)​<a·​class="indexterm"·​name="idp149487928"><​/​a></​span></​dt><dd><pre·​class="screen">turnle​ft·​X</​pre><p>144 ······​<strong·​class="userinput"><co​de>backward</​code></​strong>·​moves·​the·​turtle·​backward·​by·​the·​amount·​of·​X·​pixels.​·​When·​the·​pen·​is·​down·​the·​turtle·​will·​leave·​a·​trail.​·​<strong·​class="userinput"><co​de>backward</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>bw</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="turnleft"></​a><dl><dt><span·​class="term">turnleft​·​(tl)​<a·​class="indexterm"·​name="idp149467448"><​/​a></​span></​dt><dd><pre·​class="screen">turnle​ft·​X</​pre><p>
145 ······​<strong·​class="userinput"><co​de>turnleft</​code></​strong>·​commands·​the·​turtle·​to·​turn·​an·​amount·​of·​X·​degrees·​to·​the·​left.​·​<strong·​class="userinput"><co​de>turnleft</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>tl</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="turnright"></​a><dl><dt><span·​class="term">turnrigh​t·​(tr)​<a·​class="indexterm"·​name="idp149491768"><​/​a></​span></​dt><dd><pre·​class="screen">turnri​ght·​X</​pre><p>145 ······​<strong·​class="userinput"><co​de>turnleft</​code></​strong>·​commands·​the·​turtle·​to·​turn·​an·​amount·​of·​X·​degrees·​to·​the·​left.​·​<strong·​class="userinput"><co​de>turnleft</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>tl</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="turnright"></​a><dl><dt><span·​class="term">turnrigh​t·​(tr)​<a·​class="indexterm"·​name="idp149471288"><​/​a></​span></​dt><dd><pre·​class="screen">turnri​ght·​X</​pre><p>
146 ······​<strong·​class="userinput"><co​de>turnright</​code></​strong>·​the·​turtle·​to·​turn·​an·​amount·​of·​X·​degrees·​to·​the·​right.​·​<strong·​class="userinput"><co​de>turnright</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>tr</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="direction"></​a><dl><dt><span·​class="term">directio​n·​(dir)​<a·​class="indexterm"·​name="idp149495608"><​/​a></​span></​dt><dd><pre·​class="screen">direct​ion·​X</​pre><p>146 ······​<strong·​class="userinput"><co​de>turnright</​code></​strong>·​the·​turtle·​to·​turn·​an·​amount·​of·​X·​degrees·​to·​the·​right.​·​<strong·​class="userinput"><co​de>turnright</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>tr</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="direction"></​a><dl><dt><span·​class="term">directio​n·​(dir)​<a·​class="indexterm"·​name="idp149475128"><​/​a></​span></​dt><dd><pre·​class="screen">direct​ion·​X</​pre><p>
147 ······​<strong·​class="userinput"><co​de>direction</​code></​strong>·​set·​the·​turtle's·​direction·​to·​an·​amount·​of·​X·​degrees·​counting·​from·​zero,​·​and·​thus·​is·​not·​relative·​to·​the·​turtle's·​previous·​direction.​·​<strong·​class="userinput"><co​de>direction</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>dir</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="getdirection"><​/​a><dl><dt><span·​class="term">getdirec​tion<a·​class="indexterm"·​name="idp149499448"><​/​a></​span></​dt><dd><pre·​class="screen">getdir​ection</​pre><p>147 ······​<strong·​class="userinput"><co​de>direction</​code></​strong>·​set·​the·​turtle's·​direction·​to·​an·​amount·​of·​X·​degrees·​counting·​from·​zero,​·​and·​thus·​is·​not·​relative·​to·​the·​turtle's·​previous·​direction.​·​<strong·​class="userinput"><co​de>direction</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>dir</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="getdirection"><​/​a><dl><dt><span·​class="term">getdirec​tion<a·​class="indexterm"·​name="idp149478968"><​/​a></​span></​dt><dd><pre·​class="screen">getdir​ection</​pre><p>
148 ······​<strong·​class="userinput"><co​de>getdirection</​code></​strong>·​returns·​the·​turtle's·​direction·​as·​an·​amount·​of·​degrees·​counting·​from·​zero,​·​where·​zero·​is·​the·​direction·​when·​the·​turtle·​is·​pointing·​upwards.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="center"></​a><dl><dt><span·​class="term">center<a​·​class="indexterm"·​name="idp149502520"><​/​a></​span></​dt><dd><pre·​class="screen">center​</​pre><p>148 ······​<strong·​class="userinput"><co​de>getdirection</​code></​strong>·​returns·​the·​turtle's·​direction·​as·​an·​amount·​of·​degrees·​counting·​from·​zero,​·​where·​zero·​is·​the·​direction·​when·​the·​turtle·​is·​pointing·​upwards.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="center"></​a><dl><dt><span·​class="term">center<a​·​class="indexterm"·​name="idp149482040"><​/​a></​span></​dt><dd><pre·​class="screen">center​</​pre><p>
149 ······​<strong·​class="userinput"><co​de>center</​code></​strong>·​moves·​the·​turtle·​to·​the·​center·​on·​the·​canvas.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="go"></​a><dl><dt><span·​class="term">go<a·​class="indexterm"·​name="idp149505592"><​/​a></​span></​dt><dd><pre·​class="screen">go·​X,​Y</​pre><p>149 ······​<strong·​class="userinput"><co​de>center</​code></​strong>·​moves·​the·​turtle·​to·​the·​center·​on·​the·​canvas.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="go"></​a><dl><dt><span·​class="term">go<a·​class="indexterm"·​name="idp149485112"><​/​a></​span></​dt><dd><pre·​class="screen">go·​X,​Y</​pre><p>
150 ······​<strong·​class="userinput"><co​de>go</​code></​strong>·​commands·​the·​turtle·​to·​go·​to·​a·​certain·​place·​on·​the·​canvas.​·​This·​place·​is·​X·​<a·​class="glossterm"·​href="Glossary.​html#pixels"><em·​class="glossterm">pix​els</​em></​a>·​from·​the·​left·​of·​the·​canvas,​·​and·​Y·​<a·​class="glossterm"·​href="Glossary.​html#pixels"><em·​class="glossterm">pix​els</​em></​a>·​from·​the·​top·​of·​the·​canvas.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="gox"></​a><dl><dt><span·​class="term">gox<a·​class="indexterm"·​name="idp149509688"><​/​a></​span></​dt><dd><pre·​class="screen">gox·​X</​pre><p>150 ······​<strong·​class="userinput"><co​de>go</​code></​strong>·​commands·​the·​turtle·​to·​go·​to·​a·​certain·​place·​on·​the·​canvas.​·​This·​place·​is·​X·​<a·​class="glossterm"·​href="Glossary.​html#pixels"><em·​class="glossterm">pix​els</​em></​a>·​from·​the·​left·​of·​the·​canvas,​·​and·​Y·​<a·​class="glossterm"·​href="Glossary.​html#pixels"><em·​class="glossterm">pix​els</​em></​a>·​from·​the·​top·​of·​the·​canvas.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="gox"></​a><dl><dt><span·​class="term">gox<a·​class="indexterm"·​name="idp149489208"><​/​a></​span></​dt><dd><pre·​class="screen">gox·​X</​pre><p>
151 ······​<strong·​class="userinput"><co​de>gox</​code></​strong>·​using·​this·​command·​the·​turtle·​will·​move·​to·​X·​<a·​class="glossterm"·​href="Glossary.​html#pixels"><em·​class="glossterm">pix​els</​em></​a>·​from·​the·​left·​of·​the·​canvas·​whilst·​staying·​at·​the·​same·​height.​·​<strong·​class="userinput"><co​de>gox</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>gx</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="goy"></​a><dl><dt><span·​class="term">goy<a·​class="indexterm"·​name="idp149514040"><​/​a></​span></​dt><dd><pre·​class="screen">goy·​Y</​pre><p>151 ······​<strong·​class="userinput"><co​de>gox</​code></​strong>·​using·​this·​command·​the·​turtle·​will·​move·​to·​X·​<a·​class="glossterm"·​href="Glossary.​html#pixels"><em·​class="glossterm">pix​els</​em></​a>·​from·​the·​left·​of·​the·​canvas·​whilst·​staying·​at·​the·​same·​height.​·​<strong·​class="userinput"><co​de>gox</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>gx</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="goy"></​a><dl><dt><span·​class="term">goy<a·​class="indexterm"·​name="idp149493560"><​/​a></​span></​dt><dd><pre·​class="screen">goy·​Y</​pre><p>
152 ······​<strong·​class="userinput"><co​de>goy</​code></​strong>·​using·​this·​command·​the·​turtle·​will·​move·​to·​Y·​<a·​class="glossterm"·​href="Glossary.​html#pixels"><em·​class="glossterm">pix​els</​em></​a>·​from·​the·​top·​of·​the·​canvas·​whilst·​staying·​at·​the·​same·​distance·​from·​the·​left·​border·​of·​the·​canvas.​·​<strong·​class="userinput"><co​de>goy</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>gy</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="note"·​style="margin-​left:​·​0.​5in;​·​margin-​right:​·​0.​5in;​"><h3·​class="title">Note</​h3><p>Using·​the·​commands·​<strong·​class="userinput"><co​de>go</​code></​strong>,​·​<strong·​class="userinput"><co​de>gox</​code></​strong>,​·​<strong·​class="userinput"><co​de>goy</​code></​strong>·​and·​<strong·​class="userinput"><co​de>center</​code></​strong>·​the·​turtle·​will·​not·​draw·​a·​line,​·​no·​matter·​if·​the·​pen·​is·​up·​or·​down.​</​p></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="locate-​the-​turtle"></​a>Where·​is·​the·​turtle?</​h3></​div></​div></​div><p>There·​are·​two·​commands·​whi·​✂152 ······​<strong·​class="userinput"><co​de>goy</​code></​strong>·​using·​this·​command·​the·​turtle·​will·​move·​to·​Y·​<a·​class="glossterm"·​href="Glossary.​html#pixels"><em·​class="glossterm">pix​els</​em></​a>·​from·​the·​top·​of·​the·​canvas·​whilst·​staying·​at·​the·​same·​distance·​from·​the·​left·​border·​of·​the·​canvas.​·​<strong·​class="userinput"><co​de>goy</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>gy</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="note"·​style="margin-​left:​·​0.​5in;​·​margin-​right:​·​0.​5in;​"><h3·​class="title">Note</​h3><p>Using·​the·​commands·​<strong·​class="userinput"><co​de>go</​code></​strong>,​·​<strong·​class="userinput"><co​de>gox</​code></​strong>,​·​<strong·​class="userinput"><co​de>goy</​code></​strong>·​and·​<strong·​class="userinput"><co​de>center</​code></​strong>·​the·​turtle·​will·​not·​draw·​a·​line,​·​no·​matter·​if·​the·​pen·​is·​up·​or·​down.​</​p></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="locate-​the-​turtle"></​a>Where·​is·​the·​turtle?</​h3></​div></​div></​div><p>There·​are·​two·​commands·​whi·​✂
153 ······​<strong·​class="userinput"><co​de>getx</​code></​strong>·​returns·​the·​number·​of·​pixels·​from·​the·​left·​of·​the·​canvas·​to·​the·​current·​position·​of·​the·​turtle.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="gety"></​a><dl><dt><span·​class="term">gety<a·​class="indexterm"·​name="idp149577912"><​/​a></​span></​dt><dd><p>153 ······​<strong·​class="userinput"><co​de>getx</​code></​strong>·​returns·​the·​number·​of·​pixels·​from·​the·​left·​of·​the·​canvas·​to·​the·​current·​position·​of·​the·​turtle.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="gety"></​a><dl><dt><span·​class="term">gety<a·​class="indexterm"·​name="idp149504184"><​/​a></​span></​dt><dd><p>
154 ······​<strong·​class="userinput"><co​de>gety</​code></​strong>·​returns·​the·​number·​of·​pixels·​from·​the·​top·​of·​the·​canvas·​to·​the·​current·​position·​of·​the·​turtle.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="pen"></​a>The·​turtle·​has·​a·​pen</​h3></​div></​div></​div><p>The·​turtle·​has·​a·​pen·​that·​draws·​a·​line·​when·​the·​turtle·​moves.​·​There·​are·​a·​few·​commands·​to·​control·​the·​pen.​·​In·​this·​section·​we·​explain·​these·​commands.​</​p><div·​class="variablelist">​<a·​name="penup"></​a><dl><dt><span·​class="term">penup·​(pu)​<a·​class="indexterm"·​name="idp149582008"><​/​a></​span></​dt><dd><pre·​class="screen">penup<​/​pre><p>154 ······​<strong·​class="userinput"><co​de>gety</​code></​strong>·​returns·​the·​number·​of·​pixels·​from·​the·​top·​of·​the·​canvas·​to·​the·​current·​position·​of·​the·​turtle.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="pen"></​a>The·​turtle·​has·​a·​pen</​h3></​div></​div></​div><p>The·​turtle·​has·​a·​pen·​that·​draws·​a·​line·​when·​the·​turtle·​moves.​·​There·​are·​a·​few·​commands·​to·​control·​the·​pen.​·​In·​this·​section·​we·​explain·​these·​commands.​</​p><div·​class="variablelist">​<a·​name="penup"></​a><dl><dt><span·​class="term">penup·​(pu)​<a·​class="indexterm"·​name="idp149508280"><​/​a></​span></​dt><dd><pre·​class="screen">penup<​/​pre><p>
155 ······​<strong·​class="userinput"><co​de>penup</​code></​strong>·​lifts·​the·​pen·​from·​the·​canvas.​·​When·​the·​pen·​is·​<span·​class="quote">“<span·​class="quote">up</​span>”</​span>·​no·​line·​will·​be·​drawn·​when·​the·​turtle·​moves.​·​See·​also·​<strong·​class="userinput"><co​de>pendown</​code></​strong>.​·​<strong·​class="userinput"><co​de>penup</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>pu</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="pendown"></​a><dl><dt><span·​class="term">pendown·​(pd)​<a·​class="indexterm"·​name="idp149586616"><​/​a></​span></​dt><dd><pre·​class="screen">pendow​n</​pre><p>155 ······​<strong·​class="userinput"><co​de>penup</​code></​strong>·​lifts·​the·​pen·​from·​the·​canvas.​·​When·​the·​pen·​is·​<span·​class="quote">“<span·​class="quote">up</​span>”</​span>·​no·​line·​will·​be·​drawn·​when·​the·​turtle·​moves.​·​See·​also·​<strong·​class="userinput"><co​de>pendown</​code></​strong>.​·​<strong·​class="userinput"><co​de>penup</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>pu</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="pendown"></​a><dl><dt><span·​class="term">pendown·​(pd)​<a·​class="indexterm"·​name="idp149512888"><​/​a></​span></​dt><dd><pre·​class="screen">pendow​n</​pre><p>
156 ······​<strong·​class="userinput"><co​de>pendown</​code></​strong>·​presses·​the·​pen·​down·​on·​the·​canvas.​·​When·​the·​pen·​is·​press·​<span·​class="quote">“<span·​class="quote">down</​span>”</​span>·​on·​the·​canvas·​a·​line·​will·​be·​drawn·​when·​the·​turtle·​moves.​·​See·​also·​<strong·​class="userinput"><co​de>penup</​code></​strong>.​·​<strong·​class="userinput"><co​de>pendown</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>pd</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="setpenwidth"></​a><dl><dt><span·​class="term">penwidth​·​(pw)​<a·​class="indexterm"·​name="idp149591224"><​/​a></​span></​dt><dd><pre·​class="screen">penwid​th·​X</​pre><p>156 ······​<strong·​class="userinput"><co​de>pendown</​code></​strong>·​presses·​the·​pen·​down·​on·​the·​canvas.​·​When·​the·​pen·​is·​press·​<span·​class="quote">“<span·​class="quote">down</​span>”</​span>·​on·​the·​canvas·​a·​line·​will·​be·​drawn·​when·​the·​turtle·​moves.​·​See·​also·​<strong·​class="userinput"><co​de>penup</​code></​strong>.​·​<strong·​class="userinput"><co​de>pendown</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>pd</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="setpenwidth"></​a><dl><dt><span·​class="term">penwidth​·​(pw)​<a·​class="indexterm"·​name="idp149517496"><​/​a></​span></​dt><dd><pre·​class="screen">penwid​th·​X</​pre><p>
157 ······​<strong·​class="userinput"><co​de>penwidth</​code></​strong>·​sets·​the·​width·​of·​the·​pen·​(the·​line·​width)​·​to·​an·​amount·​of·​X·​<a·​class="glossterm"·​href="Glossary.​html#pixels"><em·​class="glossterm">pix​els</​em></​a>.​·​<strong·​class="userinput"><co​de>penwidth</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>pw</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="setfgcolor"></​a><dl><dt><span·​class="term">pencolor​·​(pc)​<a·​class="indexterm"·​name="idp149595576"><​/​a></​span></​dt><dd><pre·​class="screen">pencol​or·​R,​G,​B</​pre><p>157 ······​<strong·​class="userinput"><co​de>penwidth</​code></​strong>·​sets·​the·​width·​of·​the·​pen·​(the·​line·​width)​·​to·​an·​amount·​of·​X·​<a·​class="glossterm"·​href="Glossary.​html#pixels"><em·​class="glossterm">pix​els</​em></​a>.​·​<strong·​class="userinput"><co​de>penwidth</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>pw</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="setfgcolor"></​a><dl><dt><span·​class="term">pencolor​·​(pc)​<a·​class="indexterm"·​name="idp149521848"><​/​a></​span></​dt><dd><pre·​class="screen">pencol​or·​R,​G,​B</​pre><p>
158 ······​<strong·​class="userinput"><co​de>pencolor</​code></​strong>·​sets·​the·​color·​of·​the·​pen.​·​<strong·​class="userinput"><co​de>pencolor</​code></​strong>·​takes·​an·​<a·​class="glossterm"·​href="Glossary.​html#rgb"><em·​class="glossterm">RGB​·​combination</​em></​a>·​as·​input.​·​<strong·​class="userinput"><co​de>pencolor</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>pc</​code></​strong>.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="canvas"></​a>Commands·​to·​control·​the·​canvas</​h3></​div></​div></​div><p>There·​are·​several·​commands·​to·​control·​the·​canvas.​</​p><div·​class="variablelist">​<a·​name="resizecanvas"><​/​a><dl><dt><span·​class="term">canvassi​ze·​(cs)​<a·​class="indexterm"·​name="idp149601592"><​/​a></​span></​dt><dd><pre·​class="screen">canvas​size·​X,​Y</​pre><p>158 ······​<strong·​class="userinput"><co​de>pencolor</​code></​strong>·​sets·​the·​color·​of·​the·​pen.​·​<strong·​class="userinput"><co​de>pencolor</​code></​strong>·​takes·​an·​<a·​class="glossterm"·​href="Glossary.​html#rgb"><em·​class="glossterm">RGB​·​combination</​em></​a>·​as·​input.​·​<strong·​class="userinput"><co​de>pencolor</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>pc</​code></​strong>.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="canvas"></​a>Commands·​to·​control·​the·​canvas</​h3></​div></​div></​div><p>There·​are·​several·​commands·​to·​control·​the·​canvas.​</​p><div·​class="variablelist">​<a·​name="resizecanvas"><​/​a><dl><dt><span·​class="term">canvassi​ze·​(cs)​<a·​class="indexterm"·​name="idp149581112"><​/​a></​span></​dt><dd><pre·​class="screen">canvas​size·​X,​Y</​pre><p>
159 ······​With·​the·​<strong·​class="userinput"><co​de>canvassize</​code></​strong>·​command·​you·​can·​set·​the·​size·​of·​the·​canvas.​·​It·​takes·​X·​and·​Y·​as·​input,​·​where·​X·​is·​the·​new·​canvas·​width·​in·​<a·​class="glossterm"·​href="Glossary.​html#pixels"><em·​class="glossterm">pix​els</​em></​a>,​·​and·​Y·​is·​the·​new·​height·​of·​the·​canvas·​in·​<a·​class="glossterm"·​href="Glossary.​html#pixels"><em·​class="glossterm">pix​els</​em></​a>.​·​<strong·​class="userinput"><co​de>canvassize</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>cs</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="setbgcolor"></​a><dl><dt><span·​class="term">canvasco​lor·​(cc)​<a·​class="indexterm"·​name="idp149606456"><​/​a></​span></​dt><dd><pre·​class="screen">canvas​color·​R,​G,​B</​pre><p>159 ······​With·​the·​<strong·​class="userinput"><co​de>canvassize</​code></​strong>·​command·​you·​can·​set·​the·​size·​of·​the·​canvas.​·​It·​takes·​X·​and·​Y·​as·​input,​·​where·​X·​is·​the·​new·​canvas·​width·​in·​<a·​class="glossterm"·​href="Glossary.​html#pixels"><em·​class="glossterm">pix​els</​em></​a>,​·​and·​Y·​is·​the·​new·​height·​of·​the·​canvas·​in·​<a·​class="glossterm"·​href="Glossary.​html#pixels"><em·​class="glossterm">pix​els</​em></​a>.​·​<strong·​class="userinput"><co​de>canvassize</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>cs</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="setbgcolor"></​a><dl><dt><span·​class="term">canvasco​lor·​(cc)​<a·​class="indexterm"·​name="idp149585976"><​/​a></​span></​dt><dd><pre·​class="screen">canvas​color·​R,​G,​B</​pre><p>
160 ······​<strong·​class="userinput"><co​de>canvascolor</​code></​strong>·​set·​the·​color·​of·​the·​canvas.​·​<strong·​class="userinput"><co​de>canvascolor</​code></​strong>·​takes·​an·​<a·​class="glossterm"·​href="Glossary.​html#rgb"><em·​class="glossterm">RGB​·​combination</​em></​a>·​as·​input.​·​<strong·​class="userinput"><co​de>canvascolor</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>cc</​code></​strong>.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="clean"></​a>Commands·​to·​clean·​up</​h3></​div></​div></​div><p>There·​are·​two·​commands·​to·​clean·​up·​the·​canvas·​after·​you·​have·​made·​a·​mess.​</​p><div·​class="variablelist">​<a·​name="clear"></​a><dl><dt><span·​class="term">clear·​(ccl)​<a·​class="indexterm"·​name="idp149612472"><​/​a></​span></​dt><dd><pre·​class="screen">clear<​/​pre><p>160 ······​<strong·​class="userinput"><co​de>canvascolor</​code></​strong>·​set·​the·​color·​of·​the·​canvas.​·​<strong·​class="userinput"><co​de>canvascolor</​code></​strong>·​takes·​an·​<a·​class="glossterm"·​href="Glossary.​html#rgb"><em·​class="glossterm">RGB​·​combination</​em></​a>·​as·​input.​·​<strong·​class="userinput"><co​de>canvascolor</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>cc</​code></​strong>.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="clean"></​a>Commands·​to·​clean·​up</​h3></​div></​div></​div><p>There·​are·​two·​commands·​to·​clean·​up·​the·​canvas·​after·​you·​have·​made·​a·​mess.​</​p><div·​class="variablelist">​<a·​name="clear"></​a><dl><dt><span·​class="term">clear·​(ccl)​<a·​class="indexterm"·​name="idp149591992"><​/​a></​span></​dt><dd><pre·​class="screen">clear<​/​pre><p>
161 ······​With·​<strong·​class="userinput"><co​de>clear</​code></​strong>·​you·​can·​clean·​all·​drawings·​from·​the·​canvas.​·​All·​other·​things·​remain:​·​the·​position·​and·​angle·​of·​the·​turtle,​·​the·​canvascolor,​·​the·​visibility·​of·​the·​turtle,​·​and·​the·​canvas·​size.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="reset"></​a><dl><dt><span·​class="term">reset<a·​class="indexterm"·​name="idp149615544"><​/​a></​span></​dt><dd><pre·​class="screen">reset<​/​pre><p>161 ······​With·​<strong·​class="userinput"><co​de>clear</​code></​strong>·​you·​can·​clean·​all·​drawings·​from·​the·​canvas.​·​All·​other·​things·​remain:​·​the·​position·​and·​angle·​of·​the·​turtle,​·​the·​canvascolor,​·​the·​visibility·​of·​the·​turtle,​·​and·​the·​canvas·​size.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="reset"></​a><dl><dt><span·​class="term">reset<a·​class="indexterm"·​name="idp149595064"><​/​a></​span></​dt><dd><pre·​class="screen">reset<​/​pre><p>
162 ······​<strong·​class="userinput"><co​de>reset</​code></​strong>·​cleans·​much·​more·​thoroughly·​than·​the·​<strong·​class="userinput"><co​de>clear</​code></​strong>·​command.​·​After·​a·​<strong·​class="userinput"><co​de>reset</​code></​strong>·​command·​everything·​is·​like·​is·​was·​when·​you·​had·​just·​started·​<span·​class="application">K​Turtle</​span>.​·​The·​turtle·​is·​positioned·​at·​the·​middle·​of·​the·​screen,​·​the·​canvas·​color·​is·​white,​·​the·​turtle·​draws·​a·​black·​line·​on·​the·​canvas·​and·​the·​canvassize·​is·​set·​to·​400·​x·​400·​pixels.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="sprites"></​a>The·​turtle·​is·​a·​sprite</​h3></​div></​div></​div><p>First·​a·​brief·​explanation·​of·​what·​sprites·​are:​·​sprites·​are·​small·​pictures·​that·​can·​be·​moved·​around·​the·​screen,​·​like·​we·​often·​see·​in·​computer·​games.​·​Our·​turtle·​is·​also·​a·​sprite.​·​For·​more·​info·​see·​the·​glossary·​on·​<a·​class="glossterm"·​href="commands.​html#sprites"><em·​class="glossterm">spr​ites</​em></​a>.​·​</​p><p>Next·​you·​will·​find·​a·​full·​overview·​on·​all·​commands·​to·​w·​✂162 ······​<strong·​class="userinput"><co​de>reset</​code></​strong>·​cleans·​much·​more·​thoroughly·​than·​the·​<strong·​class="userinput"><co​de>clear</​code></​strong>·​command.​·​After·​a·​<strong·​class="userinput"><co​de>reset</​code></​strong>·​command·​everything·​is·​like·​is·​was·​when·​you·​had·​just·​started·​<span·​class="application">K​Turtle</​span>.​·​The·​turtle·​is·​positioned·​at·​the·​middle·​of·​the·​screen,​·​the·​canvas·​color·​is·​white,​·​the·​turtle·​draws·​a·​black·​line·​on·​the·​canvas·​and·​the·​canvassize·​is·​set·​to·​400·​x·​400·​pixels.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="sprites"></​a>The·​turtle·​is·​a·​sprite</​h3></​div></​div></​div><p>First·​a·​brief·​explanation·​of·​what·​sprites·​are:​·​sprites·​are·​small·​pictures·​that·​can·​be·​moved·​around·​the·​screen,​·​like·​we·​often·​see·​in·​computer·​games.​·​Our·​turtle·​is·​also·​a·​sprite.​·​For·​more·​info·​see·​the·​glossary·​on·​<a·​class="glossterm"·​href="commands.​html#sprites"><em·​class="glossterm">spr​ites</​em></​a>.​·​</​p><p>Next·​you·​will·​find·​a·​full·​overview·​on·​all·​commands·​to·​w·​✂
163 ······​<strong·​class="userinput"><co​de>spriteshow</​code></​strong>·​makes·​the·​turtle·​visible·​again·​after·​it·​has·​been·​hidden.​·​<strong·​class="userinput"><co​de>spriteshow</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>ss</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="spritehide"></​a><dl><dt><span·​class="term">spritehi​de·​(sh)​<a·​class="indexterm"·​name="idp149626552"><​/​a></​span></​dt><dd><pre·​class="screen">sprite​hide</​pre><p>163 ······​<strong·​class="userinput"><co​de>spriteshow</​code></​strong>·​makes·​the·​turtle·​visible·​again·​after·​it·​has·​been·​hidden.​·​<strong·​class="userinput"><co​de>spriteshow</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>ss</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="spritehide"></​a><dl><dt><span·​class="term">spritehi​de·​(sh)​<a·​class="indexterm"·​name="idp149606072"><​/​a></​span></​dt><dd><pre·​class="screen">sprite​hide</​pre><p>
164 ······​<strong·​class="userinput"><co​de>spritehide</​code></​strong>·​hides·​the·​turtle.​·​This·​can·​be·​used·​if·​the·​turtle·​does·​not·​fit·​in·​your·​drawing.​·​<strong·​class="userinput"><co​de>spritehide</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>sh</​code></​strong>.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="writing"></​a>Can·​the·​turtle·​write?</​h3></​div></​div></​div><p>The·​answer·​is:​·​<span·​class="quote">“<span·​class="quote">yes</​span>”</​span>.​·​The·​turtle·​can·​write:​·​it·​writes·​just·​about·​everything·​you·​command·​it·​to.​</​p><div·​class="variablelist">​<a·​name="print"></​a><dl><dt><span·​class="term">print<a·​class="indexterm"·​name="idp149632056"><​/​a></​span></​dt><dd><pre·​class="screen">print·​X</​pre><p>164 ······​<strong·​class="userinput"><co​de>spritehide</​code></​strong>·​hides·​the·​turtle.​·​This·​can·​be·​used·​if·​the·​turtle·​does·​not·​fit·​in·​your·​drawing.​·​<strong·​class="userinput"><co​de>spritehide</​code></​strong>·​can·​be·​abbreviated·​to·​<strong·​class="userinput"><co​de>sh</​code></​strong>.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="writing"></​a>Can·​the·​turtle·​write?</​h3></​div></​div></​div><p>The·​answer·​is:​·​<span·​class="quote">“<span·​class="quote">yes</​span>”</​span>.​·​The·​turtle·​can·​write:​·​it·​writes·​just·​about·​everything·​you·​command·​it·​to.​</​p><div·​class="variablelist">​<a·​name="print"></​a><dl><dt><span·​class="term">print<a·​class="indexterm"·​name="idp149611576"><​/​a></​span></​dt><dd><pre·​class="screen">print·​X</​pre><p>
165 ······​The·​<strong·​class="userinput"><co​de>print</​code></​strong>·​command·​is·​used·​to·​command·​the·​turtle·​to·​write·​something·​on·​the·​canvas.​·​<strong·​class="userinput"><co​de>print</​code></​strong>·​takes·​numbers·​and·​strings·​as·​input.​·​You·​can·​<strong·​class="userinput"><co​de>print</​code></​strong>·​various·​numbers·​and·​strings·​using·​the·​<span·​class="quote">“<span·​class="quote">+</​span>”</​span>·​symbol.​·​See·​here·​a·​small·​example:​165 ······​The·​<strong·​class="userinput"><co​de>print</​code></​strong>·​command·​is·​used·​to·​command·​the·​turtle·​to·​write·​something·​on·​the·​canvas.​·​<strong·​class="userinput"><co​de>print</​code></​strong>·​takes·​numbers·​and·​strings·​as·​input.​·​You·​can·​<strong·​class="userinput"><co​de>print</​code></​strong>·​various·​numbers·​and·​strings·​using·​the·​<span·​class="quote">“<span·​class="quote">+</​span>”</​span>·​symbol.​·​See·​here·​a·​small·​example:​
166 </​p><pre·​class="screen">166 </​p><pre·​class="screen">
167 $year·​=·​2003167 $year·​=·​2003
168 $author·​=·​"Cies"168 $author·​=·​"Cies"
169 print·​$author·​+·​"·​started·​the·​KTurtle·​project·​in·​"·​+·​$year·​+·​"·​and·​still·​enjoys·​working·​on·​it!"169 print·​$author·​+·​"·​started·​the·​KTurtle·​project·​in·​"·​+·​$year·​+·​"·​and·​still·​enjoys·​working·​on·​it!"
170 </​pre><p>170 </​pre><p>
171 ······​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="fontsize"></​a><dl><dt><span·​class="term">fontsize​<a·​class="indexterm"·​name="idp149636792"><​/​a></​span></​dt><dd><pre·​class="screen">fontsi​ze·​X</​pre><p>171 ······​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="fontsize"></​a><dl><dt><span·​class="term">fontsize​<a·​class="indexterm"·​name="idp149616312"><​/​a></​span></​dt><dd><pre·​class="screen">fontsi​ze·​X</​pre><p>
172 ······​<strong·​class="userinput"><co​de>fontsize</​code></​strong>·​sets·​the·​size·​of·​the·​font·​that·​is·​used·​by·​<strong·​class="userinput"><co​de>print</​code></​strong>.​·​<strong·​class="userinput"><co​de>fontsize</​code></​strong>·​takes·​one·​input·​which·​should·​be·​a·​number.​·​The·​size·​is·​set·​in·​<a·​class="glossterm"·​href="Glossary.​html#pixels"><em·​class="glossterm">pix​els</​em></​a>.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="math-​commands"></​a>Mathematical·​commands</​h3></​div></​div></​div><p>The·​following·​commands·​are·​<span·​class="application">K​Turtle</​span>'s·​more·​advanced·​mathematical·​commands.​</​p><div·​class="variablelist">​<a·​name="round"></​a><dl><dt><span·​class="term">round<a·​class="indexterm"·​name="idp149642808"><​/​a></​span></​dt><dd><pre·​class="screen">round(​x)​</​pre><p>172 ······​<strong·​class="userinput"><co​de>fontsize</​code></​strong>·​sets·​the·​size·​of·​the·​font·​that·​is·​used·​by·​<strong·​class="userinput"><co​de>print</​code></​strong>.​·​<strong·​class="userinput"><co​de>fontsize</​code></​strong>·​takes·​one·​input·​which·​should·​be·​a·​number.​·​The·​size·​is·​set·​in·​<a·​class="glossterm"·​href="Glossary.​html#pixels"><em·​class="glossterm">pix​els</​em></​a>.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="math-​commands"></​a>Mathematical·​commands</​h3></​div></​div></​div><p>The·​following·​commands·​are·​<span·​class="application">K​Turtle</​span>'s·​more·​advanced·​mathematical·​commands.​</​p><div·​class="variablelist">​<a·​name="round"></​a><dl><dt><span·​class="term">round<a·​class="indexterm"·​name="idp149622328"><​/​a></​span></​dt><dd><pre·​class="screen">round(​x)​</​pre><p>
173 ······​<strong·​class="userinput"><co​de>round</​code></​strong>·​the·​given·​number·​to·​the·​nearest·​integer.​173 ······​<strong·​class="userinput"><co​de>round</​code></​strong>·​the·​given·​number·​to·​the·​nearest·​integer.​
174 </​p><pre·​class="screen">174 </​p><pre·​class="screen">
175 print·​round(10.​8)​175 print·​round(10.​8)​
176 forward·​20176 forward·​20
177 print·​round(10.​3)​177 print·​round(10.​3)​
178 </​pre><p>178 </​pre><p>
179 ······​With·​this·​code·​the·​turtle·​will·​print·​the·​numbers·​11·​and·​10.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="random"></​a><dl><dt><span·​class="term">random·​(rnd)​<a·​class="indexterm"·​name="idp149646264"><​/​a></​span></​dt><dd><pre·​class="screen">random​·​X,​Y</​pre><p>179 ······​With·​this·​code·​the·​turtle·​will·​print·​the·​numbers·​11·​and·​10.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="random"></​a><dl><dt><span·​class="term">random·​(rnd)​<a·​class="indexterm"·​name="idp149629880"><​/​a></​span></​dt><dd><pre·​class="screen">random​·​X,​Y</​pre><p>
180 ······​<strong·​class="userinput"><co​de>random</​code></​strong>·​is·​a·​command·​that·​takes·​input·​and·​gives·​output.​·​As·​input·​are·​required·​two·​numbers,​·​the·​first·​(X)​·​sets·​the·​minimum·​output,​·​the·​second·​(Y)​·​sets·​the·​maximum.​·​The·​output·​is·​a·​randomly·​chosen·​number·​that·​is·​equal·​or·​greater·​than·​the·​minimum·​and·​equal·​or·​smaller·​than·​the·​maximum.​·​Here·​a·​small·​example:​180 ······​<strong·​class="userinput"><co​de>random</​code></​strong>·​is·​a·​command·​that·​takes·​input·​and·​gives·​output.​·​As·​input·​are·​required·​two·​numbers,​·​the·​first·​(X)​·​sets·​the·​minimum·​output,​·​the·​second·​(Y)​·​sets·​the·​maximum.​·​The·​output·​is·​a·​randomly·​chosen·​number·​that·​is·​equal·​or·​greater·​than·​the·​minimum·​and·​equal·​or·​smaller·​than·​the·​maximum.​·​Here·​a·​small·​example:​
181 ······​</​p><pre·​class="screen">181 ······​</​p><pre·​class="screen">
182 repeat·​500·​{182 repeat·​500·​{
183 ··​$x·​=·​random·​1,​20183 ··​$x·​=·​random·​1,​20
184 ··​forward·​$x184 ··​forward·​$x
185 ··​turnleft·​10·​-​·​$x185 ··​turnleft·​10·​-​·​$x
186 }186 }
187 </​pre><p>187 </​pre><p>
188 ······​Using·​the·​<strong·​class="userinput"><co​de>random</​code></​strong>·​command·​you·​can·​add·​a·​bit·​of·​chaos·​to·​your·​program.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="mod"></​a><dl><dt><span·​class="term">mod<a·​class="indexterm"·​name="idp149650104"><​/​a></​span></​dt><dd><pre·​class="screen">mod·​X,​Y</​pre><p>188 ······​Using·​the·​<strong·​class="userinput"><co​de>random</​code></​strong>·​command·​you·​can·​add·​a·​bit·​of·​chaos·​to·​your·​program.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="mod"></​a><dl><dt><span·​class="term">mod<a·​class="indexterm"·​name="idp149633720"><​/​a></​span></​dt><dd><pre·​class="screen">mod·​X,​Y</​pre><p>
189 ······​The·​<strong·​class="userinput"><co​de>mod</​code></​strong>·​returns·​remainder·​of·​the·​division·​of·​first·​number·​by·​the·​second·​number.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="sqrt"></​a><dl><dt><span·​class="term">sqrt<a·​class="indexterm"·​name="idp149653176"><​/​a></​span></​dt><dd><pre·​class="screen">sqrt·​X</​pre><p>189 ······​The·​<strong·​class="userinput"><co​de>mod</​code></​strong>·​returns·​remainder·​of·​the·​division·​of·​first·​number·​by·​the·​second·​number.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="sqrt"></​a><dl><dt><span·​class="term">sqrt<a·​class="indexterm"·​name="idp149636792"><​/​a></​span></​dt><dd><pre·​class="screen">sqrt·​X</​pre><p>
190 ······​The·​<strong·​class="userinput"><co​de>sqrt</​code></​strong>·​command·​is·​sued·​to·​find·​the·​square·​root·​of·​a·​number,​·​X.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="pi"></​a><dl><dt><span·​class="term">pi<a·​class="indexterm"·​name="idp149660600"><​/​a></​span></​dt><dd><pre·​class="screen">pi</​pre><p>190 ······​The·​<strong·​class="userinput"><co​de>sqrt</​code></​strong>·​command·​is·​sued·​to·​find·​the·​square·​root·​of·​a·​number,​·​X.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="pi"></​a><dl><dt><span·​class="term">pi<a·​class="indexterm"·​name="idp149640120"><​/​a></​span></​dt><dd><pre·​class="screen">pi</​pre><p>
191 ······​This·​command·​returns·​the·​constant·​Pi,​·​<strong·​class="userinput"><co​de>3.​14159</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="sin"></​a><a·​name="cos"></​a><a·​name="tan"></​a><dl><dt><span·​class="term">sin<a·​class="indexterm"·​name="idp149664440"><​/​a>,​·​cos<a·​class="indexterm"·​name="idp149664952"><​/​a>,​·​tan<a·​class="indexterm"·​name="idp149665464"><​/​a></​span></​dt><dd><p>191 ······​This·​command·​returns·​the·​constant·​Pi,​·​<strong·​class="userinput"><co​de>3.​14159</​code></​strong>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="sin"></​a><a·​name="cos"></​a><a·​name="tan"></​a><dl><dt><span·​class="term">sin<a·​class="indexterm"·​name="idp149643960"><​/​a>,​·​cos<a·​class="indexterm"·​name="idp149644472"><​/​a>,​·​tan<a·​class="indexterm"·​name="idp149644984"><​/​a></​span></​dt><dd><p>
192 </​p><pre·​class="screen">192 </​p><pre·​class="screen">
193 sin·​X193 sin·​X
194 cos·​X194 cos·​X
195 tan·​X195 tan·​X
196 </​pre><p>196 </​pre><p>
197 ······​These·​three·​commands·​represent·​the·​world·​famous·​trigoniometrical·​functions·​<strong·​class="userinput"><co​de>sin</​code></​strong>,​·​<strong·​class="userinput"><co​de>cos</​code></​strong>·​and·​<strong·​class="userinput"><co​de>tan</​code></​strong>.​·​The·​input·​argument·​of·​these·​commands,​·​X,​·​is·​a·​<a·​class="link"·​href="reference.​html#number"·​title="Numbers">numbe​r</​a>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="arcsin"></​a><a·​name="arccos"></​a><a·​name="arctan"></​a><dl><dt><span·​class="term">arcsin<a​·​class="indexterm"·​name="idp149670712"><​/​a>,​·​arccos<a·​class="indexterm"·​name="idp149671224"><​/​a>,​·​arctan<a·​class="indexterm"·​name="idp149671736"><​/​a></​span></​dt><dd><p>197 ······​These·​three·​commands·​represent·​the·​world·​famous·​trigoniometrical·​functions·​<strong·​class="userinput"><co​de>sin</​code></​strong>,​·​<strong·​class="userinput"><co​de>cos</​code></​strong>·​and·​<strong·​class="userinput"><co​de>tan</​code></​strong>.​·​The·​input·​argument·​of·​these·​commands,​·​X,​·​is·​a·​<a·​class="link"·​href="reference.​html#number"·​title="Numbers">numbe​r</​a>.​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="arcsin"></​a><a·​name="arccos"></​a><a·​name="arctan"></​a><dl><dt><span·​class="term">arcsin<a​·​class="indexterm"·​name="idp149650232"><​/​a>,​·​arccos<a·​class="indexterm"·​name="idp149650744"><​/​a>,​·​arctan<a·​class="indexterm"·​name="idp149651256"><​/​a></​span></​dt><dd><p>
198 </​p><pre·​class="screen">198 </​p><pre·​class="screen">
199 arcsin·​X199 arcsin·​X
200 arccos·​X200 arccos·​X
201 arctan·​X201 arctan·​X
202 </​pre><p>202 </​pre><p>
203 ······​These·​commands·​are·​the·​inverse·​functions·​of·​<a·​class="link"·​href="commands.​html#sin">sin</​a>,​·​<a·​class="link"·​href="commands.​html#cos">cos</​a>·​and·​<a·​class="link"·​href="commands.​html#tan">tan</​a>.​·​The·​input·​argument·​of·​these·​commands,​·​X,​·​is·​a·​<a·​class="link"·​href="reference.​html#number"·​title="Numbers">numbe​r</​a>.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="dialogs"></​a>Input·​and·​feedback·​through·​dialogs</​h3></​div></​div></​div><p>A·​dialog·​is·​a·​small·​pop-​up·​window·​that·​provides·​some·​feedback·​or·​asks·​for·​some·​input.​·​<span·​class="application">K​Turtle</​span>·​has·​two·​commands·​for·​dialogs,​·​namely:​·​<strong·​class="userinput"><co​de>message</​code></​strong>·​and·​<strong·​class="userinput"><co​de>ask</​code></​strong></​p><div·​class="variablelist">​<a·​name="message"></​a><dl><dt><span·​class="term">message<​a·​class="indexterm"·​name="idp149683000"><​/​a></​span></​dt><dd><pre·​class="screen">messag​e·​X</​pre><p>203 ······​These·​commands·​are·​the·​inverse·​functions·​of·​<a·​class="link"·​href="commands.​html#sin">sin</​a>,​·​<a·​class="link"·​href="commands.​html#cos">cos</​a>·​and·​<a·​class="link"·​href="commands.​html#tan">tan</​a>.​·​The·​input·​argument·​of·​these·​commands,​·​X,​·​is·​a·​<a·​class="link"·​href="reference.​html#number"·​title="Numbers">numbe​r</​a>.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="dialogs"></​a>Input·​and·​feedback·​through·​dialogs</​h3></​div></​div></​div><p>A·​dialog·​is·​a·​small·​pop-​up·​window·​that·​provides·​some·​feedback·​or·​asks·​for·​some·​input.​·​<span·​class="application">K​Turtle</​span>·​has·​two·​commands·​for·​dialogs,​·​namely:​·​<strong·​class="userinput"><co​de>message</​code></​strong>·​and·​<strong·​class="userinput"><co​de>ask</​code></​strong></​p><div·​class="variablelist">​<a·​name="message"></​a><dl><dt><span·​class="term">message<​a·​class="indexterm"·​name="idp149658424"><​/​a></​span></​dt><dd><pre·​class="screen">messag​e·​X</​pre><p>
204 ······​The·​<strong·​class="userinput"><co​de>message</​code></​strong>·​command·​takes·​a·​<a·​class="link"·​href="reference.​html#string"·​title="Strings">strin​g</​a>·​as·​input.​·​It·​shows·​a·​pop-​up·​dialog·​containing·​the·​text·​from·​the·​<a·​class="link"·​href="reference.​html#string"·​title="Strings">strin​g</​a>.​204 ······​The·​<strong·​class="userinput"><co​de>message</​code></​strong>·​command·​takes·​a·​<a·​class="link"·​href="reference.​html#string"·​title="Strings">strin​g</​a>·​as·​input.​·​It·​shows·​a·​pop-​up·​dialog·​containing·​the·​text·​from·​the·​<a·​class="link"·​href="reference.​html#string"·​title="Strings">strin​g</​a>.​
205 </​p><pre·​class="screen">205 </​p><pre·​class="screen">
206 message·​"Cies·​started·​KTurtle·​in·​2003·​and·​still·​enjoys·​working·​on·​it!"206 message·​"Cies·​started·​KTurtle·​in·​2003·​and·​still·​enjoys·​working·​on·​it!"
207 </​pre><p>207 </​pre><p>
208 ······​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="ask"></​a><dl><dt><span·​class="term">ask<a·​class="indexterm"·​name="idp149687480"><​/​a></​span></​dt><dd><pre·​class="screen">ask·​X</​pre><p>208 ······​</​p></​dd></​dl></​div><div·​class="variablelist">​<a·​name="ask"></​a><dl><dt><span·​class="term">ask<a·​class="indexterm"·​name="idp149662904"><​/​a></​span></​dt><dd><pre·​class="screen">ask·​X</​pre><p>
209 ······​<strong·​class="userinput"><co​de>ask</​code></​strong>·​takes·​a·​<a·​class="link"·​href="reference.​html#string"·​title="Strings">strin​g</​a>·​as·​input.​··​It·​shows·​this·​string·​in·​a·​pop-​up·​dialog·​(similar·​to·​<a·​class="link"·​href="commands.​html#message">message​</​a>)​,​·​along·​with·​an·​input·​field.​··​After·​the·​user·​has·​entered·​a·​<a·​class="link"·​href="reference.​html#number"·​title="Numbers">numbe​r</​a>·​or·​a·​<a·​class="link"·​href="reference.​html#string"·​title="Strings">strin​g</​a>·​into·​this,​·​the·​result·​can·​be·​stored·​in·​a·​<a·​class="link"·​href="assignment-​of-​variables.​html"·​title="Assignment·​of·​variables">variable</​a>·​or·​passed·​as·​an·​argument·​to·​a·​<a·​class="link"·​href="commands.​html"·​title="Commands">comm​and</​a>.​·​For·​example:​209 ······​<strong·​class="userinput"><co​de>ask</​code></​strong>·​takes·​a·​<a·​class="link"·​href="reference.​html#string"·​title="Strings">strin​g</​a>·​as·​input.​··​It·​shows·​this·​string·​in·​a·​pop-​up·​dialog·​(similar·​to·​<a·​class="link"·​href="commands.​html#message">message​</​a>)​,​·​along·​with·​an·​input·​field.​··​After·​the·​user·​has·​entered·​a·​<a·​class="link"·​href="reference.​html#number"·​title="Numbers">numbe​r</​a>·​or·​a·​<a·​class="link"·​href="reference.​html#string"·​title="Strings">strin​g</​a>·​into·​this,​·​the·​result·​can·​be·​stored·​in·​a·​<a·​class="link"·​href="assignment-​of-​variables.​html"·​title="Assignment·​of·​variables">variable</​a>·​or·​passed·​as·​an·​argument·​to·​a·​<a·​class="link"·​href="commands.​html"·​title="Commands">comm​and</​a>.​·​For·​example:​
210 </​p><pre·​class="screen">210 </​p><pre·​class="screen">
211 $in·​=·​ask·​"What·​is·​your·​year·​of·​birth?"211 $in·​=·​ask·​"What·​is·​your·​year·​of·​birth?"
212 $out·​=·​2003·​-​·​$in212 $out·​=·​2003·​-​·​$in
213 print·​"In·​2003·​you·​were·​"·​+·​$out·​+·​"·​years·​old·​at·​some·​point.​"213 print·​"In·​2003·​you·​were·​"·​+·​$out·​+·​"·​years·​old·​at·​some·​point.​"
214 </​pre><p>214 </​pre><p>
215 ······​If·​the·​user·​cancels·​the·​input·​dialog,​·​or·​does·​not·​enter·​anything·​at·​all,​·​the·​<a·​class="link"·​href="assignment-​of-​variables.​html"·​title="Assignment·​of·​variables">variable</​a>·​is·​empty.​</​p></​dd></​dl></​div></​div></​div></​div><div·​id="footer"><div·​class="navCenter"><ta​ble·​class="navigation"><t​r><td·​class="prevCell"><a·​accesskey="p"·​href="operators.​html">Prev</​a></​td><td·​class="upCell"><a·​accesskey="h"·​href="index.​html">Contents</​a></​td><td·​class="nextCell"><a·​accesskey="n"·​href="assignment-​of-​variables.​html">Next</​a></​td></​tr><tr><td·​class="prevCell">Math​ematical,​·​boolean·​and·​comparing·​operators </​td><td·​class="upCell">Turtle​Script·​Programming·​Reference</​td><td·​class="nextCell"> Ass​ignment·​of·​variables</​td></​tr></​table></​div><div·​id="footer_text">Woul​d·​you·​like·​to·​make·​a·​comment·​or·​contribute·​an·​update·​to·​this·​page?<br>Send·​feedback·​to·​the·​<a·​href="mailto:​kde-​doc-​english@kde.​org"·​class="footer_email">​KDE·​Docs·​Team</​a></​div></​div></​div></​body></​html></​FILENAME><FILENAME·​filename="assignment-​of-​variables.​html"·​✂215 ······​If·​the·​user·​cancels·​the·​input·​dialog,​·​or·​does·​not·​enter·​anything·​at·​all,​·​the·​<a·​class="link"·​href="assignment-​of-​variables.​html"·​title="Assignment·​of·​variables">variable</​a>·​is·​empty.​</​p></​dd></​dl></​div></​div></​div></​div><div·​id="footer"><div·​class="navCenter"><ta​ble·​class="navigation"><t​r><td·​class="prevCell"><a·​accesskey="p"·​href="operators.​html">Prev</​a></​td><td·​class="upCell"><a·​accesskey="h"·​href="index.​html">Contents</​a></​td><td·​class="nextCell"><a·​accesskey="n"·​href="assignment-​of-​variables.​html">Next</​a></​td></​tr><tr><td·​class="prevCell">Math​ematical,​·​boolean·​and·​comparing·​operators </​td><td·​class="upCell">Turtle​Script·​Programming·​Reference</​td><td·​class="nextCell"> Ass​ignment·​of·​variables</​td></​tr></​table></​div><div·​id="footer_text">Woul​d·​you·​like·​to·​make·​a·​comment·​or·​contribute·​an·​update·​to·​this·​page?<br>Send·​feedback·​to·​the·​<a·​href="mailto:​kde-​doc-​english@kde.​org"·​class="footer_email">​KDE·​Docs·​Team</​a></​div></​div></​div></​body></​html></​FILENAME><FILENAME·​filename="assignment-​of-​variables.​html"·​✂
Offset 238, 68 lines modifiedOffset 238, 68 lines modified
238 In·​the·​first·​two·​lines·​the·​variables·​<strong·​class="userinput"><co​de>$a</​code></​strong>·​and·​<strong·​class="userinput"><co​de>$b</​code></​strong>·​are·​set·​to·​2004·​and·​25.​·​Then·​in·​two·​<strong·​class="userinput"><co​de>print</​code></​strong>·​commands·​with·​a·​<strong·​class="userinput"><co​de>backward·​30</​code></​strong>·​in·​between·​are·​executed.​·​The·​comments·​before·​the·​<strong·​class="userinput"><co​de>print</​code></​strong>·​commands·​explain·​what·​they·​are·​doing.​·​The·​command·​<strong·​class="userinput"><co​de>backward·​30</​code></​strong>·​is·​there·​to·​make·238 In·​the·​first·​two·​lines·​the·​variables·​<strong·​class="userinput"><co​de>$a</​code></​strong>·​and·​<strong·​class="userinput"><co​de>$b</​code></​strong>·​are·​set·​to·​2004·​and·​25.​·​Then·​in·​two·​<strong·​class="userinput"><co​de>print</​code></​strong>·​commands·​with·​a·​<strong·​class="userinput"><co​de>backward·​30</​code></​strong>·​in·​between·​are·​executed.​·​The·​comments·​before·​the·​<strong·​class="userinput"><co​de>print</​code></​strong>·​commands·​explain·​what·​they·​are·​doing.​·​The·​command·​<strong·​class="userinput"><co​de>backward·​30</​code></​strong>·​is·​there·​to·​make·
239 sure·​every·​output·​is·​on·​a·​new·​line.​239 sure·​every·​output·​is·​on·​a·​new·​line.​
240 As·​you·​see·​variables·​can·​be·​used·​just·​as·​if·​their·​where·​what·​they·​contain,​·​you·​can·​use·​them·​with·​any·​kind·​of·​<a·​class="link"·​href="operators.​html"·​title="Mathematical,​·​boolean·​and·​comparing·​operators">operators<​/​a>·​or·​give·​them·​as·​input·​when·​invoking·​<a·​class="link"·​href="commands.​html"·​title="Commands">comm​ands</​a>.​</​p><p>One·​more·​example:​240 As·​you·​see·​variables·​can·​be·​used·​just·​as·​if·​their·​where·​what·​they·​contain,​·​you·​can·​use·​them·​with·​any·​kind·​of·​<a·​class="link"·​href="operators.​html"·​title="Mathematical,​·​boolean·​and·​comparing·​operators">operators<​/​a>·​or·​give·​them·​as·​input·​when·​invoking·​<a·​class="link"·​href="commands.​html"·​title="Commands">comm​ands</​a>.​</​p><p>One·​more·​example:​
241 </​p><pre·​class="screen">241 </​p><pre·​class="screen">
242 $name·​=·​ask·​"What·​is·​your·​name?"242 $name·​=·​ask·​"What·​is·​your·​name?"
243 print·​"Hi·​"·​+·​$name·​+·​"!·​Good·​luck·​while·​learning·​the·​art·​of·​programming.​.​.​"243 print·​"Hi·​"·​+·​$name·​+·​"!·​Good·​luck·​while·​learning·​the·​art·​of·​programming.​.​.​"
244 </​pre><p>244 </​pre><p>
245 Pretty·​straight·​forward.​·​Again·​you·​can·​see·​that·​the·​variable·​<strong·​class="userinput"><co​de>$name</​code></​strong>,​·​treated·​just·​like·​a·​string.​</​p><p>When·​using·​variables·​the·​<a·​class="link"·​href="the-​inspector.​html"·​title="The·​Inspector">inspector<​/​a>·​is·​very·​helpful.​·​It·​shows·​you·​the·​contents·​of·​all·​variables·​that·​are·​currently·​in·​use.​</​p></​div></​div><div·​id="footer"><div·​class="navCenter"><ta​ble·​class="navigation"><t​r><td·​class="prevCell"><a·​accesskey="p"·​href="commands.​html">Prev</​a></​td><td·​class="upCell"><a·​accesskey="h"·​href="index.​html">Contents</​a></​td><td·​class="nextCell"><a·​accesskey="n"·​href="controlling-​execution.​html">Next</​a></​td></​tr><tr><td·​class="prevCell">Comm​ands </​td><td·​class="upCell">Turtle​Script·​Programming·​Reference</​td><td·​class="nextCell"> Con​trolling·​execution</​td></​tr></​table></​div><div·​id="footer_text">Woul​d·​you·​like·​to·​make·​a·​comment·​or·​contribute·​an·​update·​to·​this·​page?<br>Send·​feedback·​to·​the·​<a·​href="mailto:​kde-​doc-​english@kde.​org"·​class="footer_email">​KDE·​Docs·​Team</​a></​div>·​✂245 Pretty·​straight·​forward.​·​Again·​you·​can·​see·​that·​the·​variable·​<strong·​class="userinput"><co​de>$name</​code></​strong>,​·​treated·​just·​like·​a·​string.​</​p><p>When·​using·​variables·​the·​<a·​class="link"·​href="the-​inspector.​html"·​title="The·​Inspector">inspector<​/​a>·​is·​very·​helpful.​·​It·​shows·​you·​the·​contents·​of·​all·​variables·​that·​are·​currently·​in·​use.​</​p></​div></​div><div·​id="footer"><div·​class="navCenter"><ta​ble·​class="navigation"><t​r><td·​class="prevCell"><a·​accesskey="p"·​href="commands.​html">Prev</​a></​td><td·​class="upCell"><a·​accesskey="h"·​href="index.​html">Contents</​a></​td><td·​class="nextCell"><a·​accesskey="n"·​href="controlling-​execution.​html">Next</​a></​td></​tr><tr><td·​class="prevCell">Comm​ands </​td><td·​class="upCell">Turtle​Script·​Programming·​Reference</​td><td·​class="nextCell"> Con​trolling·​execution</​td></​tr></​table></​div><div·​id="footer_text">Woul​d·​you·​like·​to·​make·​a·​comment·​or·​contribute·​an·​update·​to·​this·​page?<br>Send·​feedback·​to·​the·​<a·​href="mailto:​kde-​doc-​english@kde.​org"·​class="footer_email">​KDE·​Docs·​Team</​a></​div>·​✂
246 ······​<strong·​class="userinput"><co​de>wait</​code></​strong>·​makes·​the·​turtle·​wait·​for·​X·​seconds.​246 ······​<strong·​class="userinput"><co​de>wait</​code></​strong>·​makes·​the·​turtle·​wait·​for·​X·​seconds.​
247 </​p><pre·​class="screen">247 </​p><pre·​class="screen">
248 repeat·​36·​{248 repeat·​36·​{
249 ··​forward·​5249 ··​forward·​5
250 ··​turnright·​10250 ··​turnright·​10
251 ··​wait·​0.​5251 ··​wait·​0.​5
252 }252 }
253 </​pre><p>253 </​pre><p>
254 ······​This·​code·​draws·​a·​circle,​·​but·​the·​turtle·​will·​wait·​half·​a·​second254 ······​This·​code·​draws·​a·​circle,​·​but·​the·​turtle·​will·​wait·​half·​a·​second
255 ······​after·​each·​step.​·​This·​gives·​the·​impression·​of·​a·​slow-​moving·​turtle.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="if"></​a>Execute·​"if"</​h3></​div></​div></​div><div·​class="variablelist">​<dl><dt><span·​class="term">if<a·​class="indexterm"·​name="idp149747512"><​/​a></​span></​dt><dd><pre·​class="screen">if·​<a·​class="link"·​href="reference.​html#boolean-​value"·​title="Boolean·​(true/​false)​·​values">boolean</​a>·​{·​.​.​.​·​}</​pre><p>255 ······​after·​each·​step.​·​This·​gives·​the·​impression·​of·​a·​slow-​moving·​turtle.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="if"></​a>Execute·​"if"</​h3></​div></​div></​div><div·​class="variablelist">​<dl><dt><span·​class="term">if<a·​class="indexterm"·​name="idp149706552"><​/​a></​span></​dt><dd><pre·​class="screen">if·​<a·​class="link"·​href="reference.​html#boolean-​value"·​title="Boolean·​(true/​false)​·​values">boolean</​a>·​{·​.​.​.​·​}</​pre><p>
256 ······​The·​code·​that·​is·​placed·​between·​the·​brackets·​will·​only·​be·​executed·​<strong·​class="userinput"><co​de>if</​code></​strong>·​the·​<a·​class="link"·​href="reference.​html#boolean-​value"·​title="Boolean·​(true/​false)​·​values">boolean·​value</​a>·​evaluates·​<span·​class="quote">“<span·​class="quote">true</​span>”</​span>.​256 ······​The·​code·​that·​is·​placed·​between·​the·​brackets·​will·​only·​be·​executed·​<strong·​class="userinput"><co​de>if</​code></​strong>·​the·​<a·​class="link"·​href="reference.​html#boolean-​value"·​title="Boolean·​(true/​false)​·​values">boolean·​value</​a>·​evaluates·​<span·​class="quote">“<span·​class="quote">true</​span>”</​span>.​
257 ······​</​p><pre·​class="screen">257 ······​</​p><pre·​class="screen">
258 $x·​=·​6258 $x·​=·​6
259 if·​$x·​&gt;​·​5·​{259 if·​$x·​&gt;​·​5·​{
260 ··​print·​"$x·​is·​greater·​than·​five!"260 ··​print·​"$x·​is·​greater·​than·​five!"
261 }261 }
262 </​pre><p>262 </​pre><p>
263 ······​On·​the·​first·​line·​<strong·​class="userinput"><co​de>$x</​code></​strong>·​is·​set·​to·​6.​·​On·​the·​second·​line·​a·​<a·​class="link"·​href="operators.​html#comparing-​operators"·​title="Comparing·​operators">comparing·​operator</​a>·​is·​used·​to·​evaluate·​<strong·​class="userinput"><co​de>$x·​&gt;​·​5</​code></​strong>.​·​Since·​this·​evaluates·​<span·​class="quote">“<span·​class="quote">true</​span>”</​span>,​·​6·​is·​larger·​than·​5,​·​the·​execution·​controller·​<strong·​class="userinput"><co​de>if</​code></​strong>·​will·​allow·​the·​code·​between·​the·​brackets·​to·​be·​executed.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="else"></​a>If·​not,​·​in·​other·​words:​·​"else"</​h3></​div></​div></​div><div·​class="variablelist">​<dl><dt><span·​class="term">else<a·​class="indexterm"·​name="idp149754936"><​/​a></​span></​dt><dd><pre·​class="screen">if·​<a·​class="link"·​href="reference.​html#boolean-​value"·​title="Boolean·​(true/​false)​·​values">boolean</​a>·​{·​.​.​.​·​}·​else·​{·​.​.​.​·​}</​pre><p>263 ······​On·​the·​first·​line·​<strong·​class="userinput"><co​de>$x</​code></​strong>·​is·​set·​to·​6.​·​On·​the·​second·​line·​a·​<a·​class="link"·​href="operators.​html#comparing-​operators"·​title="Comparing·​operators">comparing·​operator</​a>·​is·​used·​to·​evaluate·​<strong·​class="userinput"><co​de>$x·​&gt;​·​5</​code></​strong>.​·​Since·​this·​evaluates·​<span·​class="quote">“<span·​class="quote">true</​span>”</​span>,​·​6·​is·​larger·​than·​5,​·​the·​execution·​controller·​<strong·​class="userinput"><co​de>if</​code></​strong>·​will·​allow·​the·​code·​between·​the·​brackets·​to·​be·​executed.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="else"></​a>If·​not,​·​in·​other·​words:​·​"else"</​h3></​div></​div></​div><div·​class="variablelist">​<dl><dt><span·​class="term">else<a·​class="indexterm"·​name="idp149746744"><​/​a></​span></​dt><dd><pre·​class="screen">if·​<a·​class="link"·​href="reference.​html#boolean-​value"·​title="Boolean·​(true/​false)​·​values">boolean</​a>·​{·​.​.​.​·​}·​else·​{·​.​.​.​·​}</​pre><p>
264 ······​<strong·​class="userinput"><co​de>else</​code></​strong>·​can·​be·​used·​in·​addition·​to·​the·​execution·​controller·​<a·​class="link"·​href="controlling-​execution.​html#if"·​title='Execute·​"if"'><strong·​class="userinput"><co​de>if</​code></​strong></​a>.​·​The·​code·​between·​the·​brackets·​after·​<strong·​class="userinput"><co​de>else</​code></​strong>·​is·​only·​executed·​if·​the·​<a·​class="link"·​href="reference.​html#boolean-​value"·​title="Boolean·​(true/​false)​·​values">boolean</​a>·​evaluates·​<span·​class="quote">“<span·​class="quote">false</​span>”</​span>.​264 ······​<strong·​class="userinput"><co​de>else</​code></​strong>·​can·​be·​used·​in·​addition·​to·​the·​execution·​controller·​<a·​class="link"·​href="controlling-​execution.​html#if"·​title='Execute·​"if"'><strong·​class="userinput"><co​de>if</​code></​strong></​a>.​·​The·​code·​between·​the·​brackets·​after·​<strong·​class="userinput"><co​de>else</​code></​strong>·​is·​only·​executed·​if·​the·​<a·​class="link"·​href="reference.​html#boolean-​value"·​title="Boolean·​(true/​false)​·​values">boolean</​a>·​evaluates·​<span·​class="quote">“<span·​class="quote">false</​span>”</​span>.​
265 ······​</​p><pre·​class="screen">265 ······​</​p><pre·​class="screen">
266 reset266 reset
267 $x·​=·​4267 $x·​=·​4
268 if·​$x·​&gt;​·​5·​{268 if·​$x·​&gt;​·​5·​{
269 ··​print·​"$x·​is·​greater·​than·​five!"269 ··​print·​"$x·​is·​greater·​than·​five!"
270 }·​else·​{270 }·​else·​{
271 ··​print·​"$x·​is·​smaller·​than·​six!"271 ··​print·​"$x·​is·​smaller·​than·​six!"
272 }272 }
273 </​pre><p>273 </​pre><p>
274 ······​The·​<a·​class="link"·​href="operators.​html#comparing-​operators"·​title="Comparing·​operators">comparing·​operator</​a>·​evaluates·​the·​expression·​<strong·​class="userinput"><co​de>$x·​&gt;​·​5</​code></​strong>.​·​Since·​4·​is·​not·​greater·​than·​5·​the·​expression·​evaluates·​<span·​class="quote">“<span·​class="quote">false</​span>”</​span>.​·​This·​means·​the·​code·​between·​the·​brackets·​after·​<strong·​class="userinput"><co​de>else</​code></​strong>·​gets·​executed.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="while"></​a>The·​"while"·​loop</​h3></​div></​div></​div><div·​class="variablelist">​<dl><dt><span·​class="term">while<a·​class="indexterm"·​name="idp149775288"><​/​a></​span></​dt><dd><pre·​class="screen">while·​<a·​class="link"·​href="reference.​html#boolean-​value"·​title="Boolean·​(true/​false)​·​values">boolean</​a>·​{·​.​.​.​·​}</​pre><p>274 ······​The·​<a·​class="link"·​href="operators.​html#comparing-​operators"·​title="Comparing·​operators">comparing·​operator</​a>·​evaluates·​the·​expression·​<strong·​class="userinput"><co​de>$x·​&gt;​·​5</​code></​strong>.​·​Since·​4·​is·​not·​greater·​than·​5·​the·​expression·​evaluates·​<span·​class="quote">“<span·​class="quote">false</​span>”</​span>.​·​This·​means·​the·​code·​between·​the·​brackets·​after·​<strong·​class="userinput"><co​de>else</​code></​strong>·​gets·​executed.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="while"></​a>The·​"while"·​loop</​h3></​div></​div></​div><div·​class="variablelist">​<dl><dt><span·​class="term">while<a·​class="indexterm"·​name="idp149754808"><​/​a></​span></​dt><dd><pre·​class="screen">while·​<a·​class="link"·​href="reference.​html#boolean-​value"·​title="Boolean·​(true/​false)​·​values">boolean</​a>·​{·​.​.​.​·​}</​pre><p>
275 ······​The·​execution·​controller·​<strong·​class="userinput"><co​de>while</​code></​strong>·​is·​a·​lot·​like·​<a·​class="link"·​href="controlling-​execution.​html#if"·​title='Execute·​"if"'><strong·​class="userinput"><co​de>if</​code></​strong></​a>.​·​The·​difference·​is·​that·​<strong·​class="userinput"><co​de>while</​code></​strong>·​keeps·​repeating·​(looping)​·​the·​code·​between·​the·​brackets·​until·​the·​<a·​class="link"·​href="reference.​html#boolean-​value"·​title="Boolean·​(true/​false)​·​values">boolean</​a>·​evaluates·​<span·​class="quote">“<span·​class="quote">false</​span>”</​span>.​275 ······​The·​execution·​controller·​<strong·​class="userinput"><co​de>while</​code></​strong>·​is·​a·​lot·​like·​<a·​class="link"·​href="controlling-​execution.​html#if"·​title='Execute·​"if"'><strong·​class="userinput"><co​de>if</​code></​strong></​a>.​·​The·​difference·​is·​that·​<strong·​class="userinput"><co​de>while</​code></​strong>·​keeps·​repeating·​(looping)​·​the·​code·​between·​the·​brackets·​until·​the·​<a·​class="link"·​href="reference.​html#boolean-​value"·​title="Boolean·​(true/​false)​·​values">boolean</​a>·​evaluates·​<span·​class="quote">“<span·​class="quote">false</​span>”</​span>.​
276 ······​</​p><pre·​class="screen">276 ······​</​p><pre·​class="screen">
277 $x·​=·​1277 $x·​=·​1
278 while·​$x·​&lt;​·​5·​{278 while·​$x·​&lt;​·​5·​{
279 ··​forward·​10279 ··​forward·​10
280 ··​wait·​1280 ··​wait·​1
281 ··​$x·​=·​$x·​+·​1281 ··​$x·​=·​$x·​+·​1
282 }282 }
283 </​pre><p>283 </​pre><p>
284 ······​On·​the·​first·​line·​<strong·​class="userinput"><co​de>$x</​code></​strong>·​is·​set·​to·​1.​·​On·​the·​second·​line·​<strong·​class="userinput"><co​de>$x·​&lt;​·​5</​code></​strong>·​is·​evaluated.​·​Since·​the·​answer·​to·​this·​question·​is·​<span·​class="quote">“<span·​class="quote">true</​span>”</​span>·​the·​execution·​controller·​<strong·​class="userinput"><co​de>while</​code></​strong>·​starts·​executing·​the·​code·​between·​the·​brackets·​until·​the·​<strong·​class="userinput"><co​de>$x·​&lt;​·​5</​code></​strong>·​evaluates·​<span·​class="quote">“<span·​class="quote">false</​span>”</​span>.​·​In·​this·​case·​the·​code·​between·​the·​brackets·​will·​be·​executed·​4·​times,​·​because·​every·​time·​the·​fifth·​line·​is·​executed·​<strong·​class="userinput"><co​de>$x</​code></​strong>·​increases·​by·​1.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="repeat"></​a>The·​"repeat"·​loop</​h3></​div></​div></​div><div·​class="variablelist">​<dl><dt><span·​class="term">repeat<a​·​class="indexterm"·​name="idp149784504"><​/​a></​span></​dt><dd><pre·​class="screen">re·​✂284 ······​On·​the·​first·​line·​<strong·​class="userinput"><co​de>$x</​code></​strong>·​is·​set·​to·​1.​·​On·​the·​second·​line·​<strong·​class="userinput"><co​de>$x·​&lt;​·​5</​code></​strong>·​is·​evaluated.​·​Since·​the·​answer·​to·​this·​question·​is·​<span·​class="quote">“<span·​class="quote">true</​span>”</​span>·​the·​execution·​controller·​<strong·​class="userinput"><co​de>while</​code></​strong>·​starts·​executing·​the·​code·​between·​the·​brackets·​until·​the·​<strong·​class="userinput"><co​de>$x·​&lt;​·​5</​code></​strong>·​evaluates·​<span·​class="quote">“<span·​class="quote">false</​span>”</​span>.​·​In·​this·​case·​the·​code·​between·​the·​brackets·​will·​be·​executed·​4·​times,​·​because·​every·​time·​the·​fifth·​line·​is·​executed·​<strong·​class="userinput"><co​de>$x</​code></​strong>·​increases·​by·​1.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="repeat"></​a>The·​"repeat"·​loop</​h3></​div></​div></​div><div·​class="variablelist">​<dl><dt><span·​class="term">repeat<a​·​class="indexterm"·​name="idp149764024"><​/​a></​span></​dt><dd><pre·​class="screen">re·​✂
285 ······​The·​execution·​controller·​<strong·​class="userinput"><co​de>repeat</​code></​strong>·​is·​a·​lot·​like·​<a·​class="link"·​href="controlling-​execution.​html#while"·​title='The·​"while"·​loop'><strong·​class="userinput"><co​de>while</​code></​strong></​a>.​·​The·​difference·​is·​that·​<strong·​class="userinput"><co​de>repeat</​code></​strong>·​keeps·​repeating·​(looping)​·​the·​code·​between·​the·​brackets·​for·​as·​many·​times·​as·​the·​given·​number.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="for"></​a>The·​"for"·​loop,​·​a·​counting·​loop</​h3></​div></​div></​div><div·​class="variablelist">​<dl><dt><span·​class="term">for<a·​class="indexterm"·​name="idp143092664"><​/​a><a·​class="indexterm"·​name="idp143093048"><​/​a></​span></​dt><dd><pre·​class="screen">for·​<a·​class="link"·​href="assignment-​of-​variables.​html"·​title="Assignment·​of·​variables">variable</​a>·​=·​<a·​class="link"·​href="reference.​html#number"·​title="Numbers">numbe​r</​a>·​to·​<a·​class="link"·​href="reference.​html#number"·​title="Numbers">numbe​r</​a>·​{·​.​.​.​·​}</​pre·​✂285 ······​The·​execution·​controller·​<strong·​class="userinput"><co​de>repeat</​code></​strong>·​is·​a·​lot·​like·​<a·​class="link"·​href="controlling-​execution.​html#while"·​title='The·​"while"·​loop'><strong·​class="userinput"><co​de>while</​code></​strong></​a>.​·​The·​difference·​is·​that·​<strong·​class="userinput"><co​de>repeat</​code></​strong>·​keeps·​repeating·​(looping)​·​the·​code·​between·​the·​brackets·​for·​as·​many·​times·​as·​the·​given·​number.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="for"></​a>The·​"for"·​loop,​·​a·​counting·​loop</​h3></​div></​div></​div><div·​class="variablelist">​<dl><dt><span·​class="term">for<a·​class="indexterm"·​name="idp149769144"><​/​a><a·​class="indexterm"·​name="idp149769528"><​/​a></​span></​dt><dd><pre·​class="screen">for·​<a·​class="link"·​href="assignment-​of-​variables.​html"·​title="Assignment·​of·​variables">variable</​a>·​=·​<a·​class="link"·​href="reference.​html#number"·​title="Numbers">numbe​r</​a>·​to·​<a·​class="link"·​href="reference.​html#number"·​title="Numbers">numbe​r</​a>·​{·​.​.​.​·​}</​pre·​✂
286 ······​The·​<strong·​class="userinput"><co​de>for</​code></​strong>·​loop·​is·​a·​<span·​class="quote">“<span·​class="quote">countin​g·​loop</​span>”</​span>,​·​<abbr·​class="abbrev">i.​e.​</​abbr>·​it·​keeps·​count·​for·​you.​·​The·​first·​number·​sets·​the·​variable·​to·​the·​value·​in·​the·​first·​loop.​·​Every·​loop·​the·​number·​is·​increased·​until·​the·​second·​number·​is·​reached.​286 ······​The·​<strong·​class="userinput"><co​de>for</​code></​strong>·​loop·​is·​a·​<span·​class="quote">“<span·​class="quote">countin​g·​loop</​span>”</​span>,​·​<abbr·​class="abbrev">i.​e.​</​abbr>·​it·​keeps·​count·​for·​you.​·​The·​first·​number·​sets·​the·​variable·​to·​the·​value·​in·​the·​first·​loop.​·​Every·​loop·​the·​number·​is·​increased·​until·​the·​second·​number·​is·​reached.​
287 ······​</​p><pre·​class="screen">287 ······​</​p><pre·​class="screen">
288 for·​$x·​=·​1·​to·​10·​{288 for·​$x·​=·​1·​to·​10·​{
289 ··​print·​$x·​*·​7289 ··​print·​$x·​*·​7
290 ··​forward·​15290 ··​forward·​15
291 }291 }
292 </​pre><p>292 </​pre><p>
293 ·····​Every·​time·​the·​code·​between·​the·​brackets·​is·​executed·​the·​<strong·​class="userinput"><co​de>$x</​code></​strong>·​is·​increased·​by·​1,​·​until·​<strong·​class="userinput"><co​de>$x</​code></​strong>·​reaches·​the·​value·​of·​10.​·​The·​code·​between·​the·​brackets·​prints·​the·​<strong·​class="userinput"><co​de>$x</​code></​strong>·​multiplied·​by·​7.​·​After·​this·​program·​finishes·​its·​execution·​you·​will·​see·​the·​times·​table·​of·​7·​on·​the·​canvas.​293 ·····​Every·​time·​the·​code·​between·​the·​brackets·​is·​executed·​the·​<strong·​class="userinput"><co​de>$x</​code></​strong>·​is·​increased·​by·​1,​·​until·​<strong·​class="userinput"><co​de>$x</​code></​strong>·​reaches·​the·​value·​of·​10.​·​The·​code·​between·​the·​brackets·​prints·​the·​<strong·​class="userinput"><co​de>$x</​code></​strong>·​multiplied·​by·​7.​·​After·​this·​program·​finishes·​its·​execution·​you·​will·​see·​the·​times·​table·​of·​7·​on·​the·​canvas.​
294 ·····​</​p><p>294 ·····​</​p><p>
295 ·····​The·​default·​step·​size·​of·​a·​loop·​is·​1,​·​you·​can·​use·​an·​other·​value·​with295 ·····​The·​default·​step·​size·​of·​a·​loop·​is·​1,​·​you·​can·​use·​an·​other·​value·​with
296 ·····​</​p><pre·​class="screen">for·​<a·​class="link"·​href="assignment-​of-​variables.​html"·​title="Assignment·​of·​variables">variable</​a>·​=·​<a·​class="link"·​href="reference.​html#number"·​title="Numbers">numbe​r</​a>·​to·​<a·​class="link"·​href="reference.​html#number"·​title="Numbers">numbe​r</​a>·​step·​<a·​class="link"·​href="reference.​html#number"·​title="Numbers">numbe​r</​a>·​{·​.​.​.​·​}</​pre></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="break"></​a>Leave·​a·​loop</​h3></​div></​div></​div><div·​class="variablelist">​<dl><dt><span·​class="term">break<a·​class="indexterm"·​name="idp149808696"><​/​a></​span></​dt><dd><pre·​class="screen">break<​/​pre><p>296 ·····​</​p><pre·​class="screen">for·​<a·​class="link"·​href="assignment-​of-​variables.​html"·​title="Assignment·​of·​variables">variable</​a>·​=·​<a·​class="link"·​href="reference.​html#number"·​title="Numbers">numbe​r</​a>·​to·​<a·​class="link"·​href="reference.​html#number"·​title="Numbers">numbe​r</​a>·​step·​<a·​class="link"·​href="reference.​html#number"·​title="Numbers">numbe​r</​a>·​{·​.​.​.​·​}</​pre></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="break"></​a>Leave·​a·​loop</​h3></​div></​div></​div><div·​class="variablelist">​<dl><dt><span·​class="term">break<a·​class="indexterm"·​name="idp149792312"><​/​a></​span></​dt><dd><pre·​class="screen">break<​/​pre><p>
297 ······​Terminates·​the·​current·​loop·​immediately·​and·​transfers·​control·​to·​the·​statement·​immediately·​following·​that·​loop.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="exit"></​a>Stop·​executing·​your·​program</​h3></​div></​div></​div><div·​class="variablelist">​<dl><dt><span·​class="term">exit<a·​class="indexterm"·​name="idp149812024"><​/​a></​span></​dt><dd><pre·​class="screen">exit</​pre><p>297 ······​Terminates·​the·​current·​loop·​immediately·​and·​transfers·​control·​to·​the·​statement·​immediately·​following·​that·​loop.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="exit"></​a>Stop·​executing·​your·​program</​h3></​div></​div></​div><div·​class="variablelist">​<dl><dt><span·​class="term">exit<a·​class="indexterm"·​name="idp149795640"><​/​a></​span></​dt><dd><pre·​class="screen">exit</​pre><p>
298 ······​Finishes·​the·​execution·​of·​your·​program.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="assert"></​a>Checking·​assertions·​at·​runtime</​h3></​div></​div></​div><div·​class="variablelist">​<dl><dt><span·​class="term">assert<a​·​class="indexterm"·​name="idp149815224"><​/​a></​span></​dt><dd><pre·​class="screen">assert​·​<a·​class="link"·​href="reference.​html#boolean-​value"·​title="Boolean·​(true/​false)​·​values">boolean</​a></​pre><p>298 ······​Finishes·​the·​execution·​of·​your·​program.​</​p></​dd></​dl></​div></​div><div·​class="sect2"><div·​class="titlepage"><di​v><div><h3·​class="title"><a·​name="assert"></​a>Checking·​assertions·​at·​runtime</​h3></​div></​div></​div><div·​class="variablelist">​<dl><dt><span·​class="term">assert<a​·​class="indexterm"·​name="idp149798840"><​/​a></​span></​dt><dd><pre·​class="screen">assert​·​<a·​class="link"·​href="reference.​html#boolean-​value"·​title="Boolean·​(true/​false)​·​values">boolean</​a></​pre><p>
299 ······​Can·​be·​used·​to·​reason·​about·​program·​or·​input·​correctness.​299 ······​Can·​be·​used·​to·​reason·​about·​program·​or·​input·​correctness.​
300 ······​</​p><pre·​class="screen">300 ······​</​p><pre·​class="screen">
301 $in·​=·​ask·​"What·​is·​your·​year·​of·​birth?"301 $in·​=·​ask·​"What·​is·​your·​year·​of·​birth?"
302 #·​the·​year·​must·​be·​positive302 #·​the·​year·​must·​be·​positive
303 assert·​$in·​&gt;​·​0303 assert·​$in·​&gt;​·​0
304 </​pre></​dd></​dl></​div></​div></​div></​div><div·​id="footer"><div·​class="navCenter"><ta​ble·​class="navigation"><t​r><td·​class="prevCell"><a·​accesskey="p"·​href="assignment-​of-​variables.​html">Prev</​a></​td><td·​class="upCell"><a·​accesskey="h"·​href="index.​html">Contents</​a></​td><td·​class="nextCell"><a·​accesskey="n"·​href="learn.​html">Next</​a></​td></​tr><tr><td·​class="prevCell">Assi​gnment·​of·​variables </​td><td·​class="upCell">Turtle​Script·​Programming·​Reference</​td><td·​class="nextCell"> Cre​ate·​your·​own·​commands·​with·​<span·​class="quote">“<span·​class="quote">learn</​span>”</​span></​td></​tr></​table></​div><div·​id="footer_text">Woul​d·​you·​like·​to·​make·​a·​comment·​or·​contribute·​an·​update·​to·​this·​page?<br>Send·​feedback·​to·​the·​<a·​href="mailto:​kde-​doc-​english@kde.​org"·​class="footer_email">​KDE·​Docs·​Team</​a></​div></​div></​div></​body></​html></​FILENAME><FILENAME·​filename="learn.​html"><html><head><ti​tle>Create·​your·​own·​commands·​with·​“learn”</​title><link·​rel="stylesheet"·​type="text/​css"·​href="help:​/​common/​kde-​default.​css"><link·​rel="stylesheet"··​✂304 </​pre></​dd></​dl></​div></​div></​div></​div><div·​id="footer"><div·​class="navCenter"><ta​ble·​class="navigation"><t​r><td·​class="prevCell"><a·​accesskey="p"·​href="assignment-​of-​variables.​html">Prev</​a></​td><td·​class="upCell"><a·​accesskey="h"·​href="index.​html">Contents</​a></​td><td·​class="nextCell"><a·​accesskey="n"·​href="learn.​html">Next</​a></​td></​tr><tr><td·​class="prevCell">Assi​gnment·​of·​variables </​td><td·​class="upCell">Turtle​Script·​Programming·​Reference</​td><td·​class="nextCell"> Cre​ate·​your·​own·​commands·​with·​<span·​class="quote">“<span·​class="quote">learn</​span>”</​span></​td></​tr></​table></​div><div·​id="footer_text">Woul​d·​you·​like·​to·​make·​a·​comment·​or·​contribute·​an·​update·​to·​this·​page?<br>Send·​feedback·​to·​the·​<a·​href="mailto:​kde-​doc-​english@kde.​org"·​class="footer_email">​KDE·​Docs·​Team</​a></​div></​div></​div></​body></​html></​FILENAME><FILENAME·​filename="learn.​html"><html><head><ti​tle>Create·​your·​own·​commands·​with·​“learn”</​title><link·​rel="stylesheet"·​type="text/​css"·​href="help:​/​common/​kde-​default.​css"><link·​rel="stylesheet"··​✂
305 </​p><pre·​class="screen">305 </​p><pre·​class="screen">
Offset 371, 17 lines modifiedOffset 371, 17 lines modified
371 </​pre><p>371 </​pre><p>
372 The·​<strong·​class="userinput"><co​de>ask</​code></​strong>·​command·​takes·​a·​string·​as·​input,​·​and·​outputs·​the·​number·​or·​string·​that·​is·​entered.​·​As·​you·​can·​see,​·​the·​output·​of·​<strong·​class="userinput"><co​de>ask</​code></​strong>·​is·​stored·​in·​the·​container·​<strong·​class="userinput"><co​de>x</​code></​strong>.​·​The·​<strong·​class="userinput"><co​de>random</​code></​strong>·​command·​also·​gives·​output.​·​In·​this·​case·​it·​outputs·​a·​number·​between·​1·​and·​100.​·​The·​output·​of·​the·​random·​is·​again·​stored·​in·​a·​container,​·​named·​<strong·​class="userinput"><co​de>r</​code></​strong>.​·​Note·​that·​the·​containers·​<strong·​class="userinput"><co​de>x</​code></​strong>·​and·​<strong·​class="userinput"><co​de>r</​code></​strong>·​are·​not·​used·​in·​the·​example·​code·​above.​</​p><p>There·​are·​also·​commands·​that·​neither·​need·​input·​nor·​give·​output.​·​Here·​are·​some·​examples:​372 The·​<strong·​class="userinput"><co​de>ask</​code></​strong>·​command·​takes·​a·​string·​as·​input,​·​and·​outputs·​the·​number·​or·​string·​that·​is·​entered.​·​As·​you·​can·​see,​·​the·​output·​of·​<strong·​class="userinput"><co​de>ask</​code></​strong>·​is·​stored·​in·​the·​container·​<strong·​class="userinput"><co​de>x</​code></​strong>.​·​The·​<strong·​class="userinput"><co​de>random</​code></​strong>·​command·​also·​gives·​output.​·​In·​this·​case·​it·​outputs·​a·​number·​between·​1·​and·​100.​·​The·​output·​of·​the·​random·​is·​again·​stored·​in·​a·​container,​·​named·​<strong·​class="userinput"><co​de>r</​code></​strong>.​·​Note·​that·​the·​containers·​<strong·​class="userinput"><co​de>x</​code></​strong>·​and·​<strong·​class="userinput"><co​de>r</​code></​strong>·​are·​not·​used·​in·​the·​example·​code·​above.​</​p><p>There·​are·​also·​commands·​that·​neither·​need·​input·​nor·​give·​output.​·​Here·​are·​some·​examples:​
373 </​p><pre·​class="screen">373 </​p><pre·​class="screen">
374 clear374 clear
375 penup375 penup
376 </​pre><p>376 </​pre><p>
377 </​p></​dd><dt><a·​name="intuitive-​highlighting"></​a>intuitive·​highlighting</​dt><dd><p>This·​is·​a·​feature·​of·​<span·​class="application">K​Turtle</​span>·​that·​makes·​coding·​even·​easier.​·​With·​intuitive·​highlighting·​the·​code·​that·​you·​write·​gets·​a·​color·​that·​indicates·​what·​type·​of·​code·​it·​is.​·​In·​the·​next·​list·​you·​will·​find·​the·​different·​types·​of·​code·​and·​the·​color·​they·​get·​in·​<a·​class="link"·​href="using-​kturtle.​html#the-​editor"·​title="The·​Editor">the·​editor</​a>.​377 </​p></​dd><dt><a·​name="intuitive-​highlighting"></​a>intuitive·​highlighting</​dt><dd><p>This·​is·​a·​feature·​of·​<span·​class="application">K​Turtle</​span>·​that·​makes·​coding·​even·​easier.​·​With·​intuitive·​highlighting·​the·​code·​that·​you·​write·​gets·​a·​color·​that·​indicates·​what·​type·​of·​code·​it·​is.​·​In·​the·​next·​list·​you·​will·​find·​the·​different·​types·​of·​code·​and·​the·​color·​they·​get·​in·​<a·​class="link"·​href="using-​kturtle.​html#the-​editor"·​title="The·​Editor">the·​editor</​a>.​
378 </​p><div·​class="table"><a·​name="idp150174008"><​/​a><p·​class="title"><b>Tabl​e 5.​1.​ Different·​types·​of·​code·​and·​their·​highlight·​color</​b></​p><div·​class="table-​contents"><table·​summary="Different·​types·​of·​code·​and·​their·​highlight·​color"·​border="1"><colgroup>​<col><col><col></​colgroup><tbody><tr><​td>regular·​commands</​td><td>dark·​blue</​td><td>The·​regular·​commands·​are·​described·​<a·​class="link"·​href="commands.​html"·​title="Commands">here​</​a>.​</​td></​tr><tr><td>execution·​controlling·​commands</​td><td>black·​(bold)​</​td><td>These·​special·​commands·​control·​execution,​·​read·​more·​on·​them·​<a·​class="link"·​href="controlling-​execution.​html"·​title="Controlling·​execution">here</​a>.​</​td></​tr><tr><td>comments</​td><td>gray</​td><td>Lines·​that·​are·​commented·​start·​with·​a·​comment·​characters·​(#)​.​·​These·​lines·​are·​ignored·​when·​the·​code·​is·​executed.​·​Comments·​allow·​the·​programmer·​to·​explain·​a·​bit·​about·​his·​code·​or·​can·​be·​used·​to·​temporarily·​prevent·​a·​certain·​piece·​of·​code·​from·​executing.​</​td></​tr><tr><td>brackets·​{,​·​}</​td><td>dark·​green·​(bold)​</​td·​✂378 </​p><div·​class="table"><a·​name="idp150169912"><​/​a><p·​class="title"><b>Tabl​e 5.​1.​ Different·​types·​of·​code·​and·​their·​highlight·​color</​b></​p><div·​class="table-​contents"><table·​summary="Different·​types·​of·​code·​and·​their·​highlight·​color"·​border="1"><colgroup>​<col><col><col></​colgroup><tbody><tr><​td>regular·​commands</​td><td>dark·​blue</​td><td>The·​regular·​commands·​are·​described·​<a·​class="link"·​href="commands.​html"·​title="Commands">here​</​a>.​</​td></​tr><tr><td>execution·​controlling·​commands</​td><td>black·​(bold)​</​td><td>These·​special·​commands·​control·​execution,​·​read·​more·​on·​them·​<a·​class="link"·​href="controlling-​execution.​html"·​title="Controlling·​execution">here</​a>.​</​td></​tr><tr><td>comments</​td><td>gray</​td><td>Lines·​that·​are·​commented·​start·​with·​a·​comment·​characters·​(#)​.​·​These·​lines·​are·​ignored·​when·​the·​code·​is·​executed.​·​Comments·​allow·​the·​programmer·​to·​explain·​a·​bit·​about·​his·​code·​or·​can·​be·​used·​to·​temporarily·​prevent·​a·​certain·​piece·​of·​code·​from·​executing.​</​td></​tr><tr><td>brackets·​{,​·​}</​td><td>dark·​green·​(bold)​</​td·​✂
379 </​p></​dd><dt><a·​name="pixels"></​a>pixels</​dt><dd><p>A·​pixel·​is·​a·​dot·​on·​the·​screen.​·​If·​you·​look·​very·​close·​you·​will·​see·​that·​the·​screen·​of·​your·​monitor·​uses·​pixels.​·​All·​images·​on·​the·​screen·​are·​built·​with·​these·​pixels.​·​A·​pixel·​is·​the·​smallest·​thing·​that·​can·​be·​drawn·​on·​the·​screen.​</​p><p>A·​lot·​of·​commands·​need·​a·​number·​of·​pixels·​as·​input.​·​These·​commands·​are:​·​<strong·​class="userinput"><co​de>forward</​code></​strong>,​·​<strong·​class="userinput"><co​de>backward</​code></​strong>,​·​<strong·​class="userinput"><co​de>go</​code></​strong>,​·​<strong·​class="userinput"><co​de>gox</​code></​strong>,​·​<strong·​class="userinput"><co​de>goy</​code></​strong>,​·​<strong·​class="userinput"><co​de>canvassize</​code></​strong>·​and·​<strong·​class="userinput"><co​de>penwidth</​code></​strong>.​</​p><p>In·​early·​versions·​of·​<span·​class="application">K​Turtle</​span>·​the·​canvas·​was·​essentially·​a·​raster·​image,​·​yet·​for·​recent·​versions·​the·​canvas·​is·​a·​vector·​drawing.​·​This·​means·​that·​the·​canvas·​can·​be·​zoomed·​in·​and·​out,​·​therefore·​a·​pixel·​does·​not·​necessarily·​have·​to·​tra·​✂379 </​p></​dd><dt><a·​name="pixels"></​a>pixels</​dt><dd><p>A·​pixel·​is·​a·​dot·​on·​the·​screen.​·​If·​you·​look·​very·​close·​you·​will·​see·​that·​the·​screen·​of·​your·​monitor·​uses·​pixels.​·​All·​images·​on·​the·​screen·​are·​built·​with·​these·​pixels.​·​A·​pixel·​is·​the·​smallest·​thing·​that·​can·​be·​drawn·​on·​the·​screen.​</​p><p>A·​lot·​of·​commands·​need·​a·​number·​of·​pixels·​as·​input.​·​These·​commands·​are:​·​<strong·​class="userinput"><co​de>forward</​code></​strong>,​·​<strong·​class="userinput"><co​de>backward</​code></​strong>,​·​<strong·​class="userinput"><co​de>go</​code></​strong>,​·​<strong·​class="userinput"><co​de>gox</​code></​strong>,​·​<strong·​class="userinput"><co​de>goy</​code></​strong>,​·​<strong·​class="userinput"><co​de>canvassize</​code></​strong>·​and·​<strong·​class="userinput"><co​de>penwidth</​code></​strong>.​</​p><p>In·​early·​versions·​of·​<span·​class="application">K​Turtle</​span>·​the·​canvas·​was·​essentially·​a·​raster·​image,​·​yet·​for·​recent·​versions·​the·​canvas·​is·​a·​vector·​drawing.​·​This·​means·​that·​the·​canvas·​can·​be·​zoomed·​in·​and·​out,​·​therefore·​a·​pixel·​does·​not·​necessarily·​have·​to·​tra·​✂
380 </​p><div·​class="table"><a·​name="idp150217400"><​/​a><p·​class="title"><b>Tabl​e 5.​2.​ Often·​used·​RGB·​combinations</​b></​p><div·​class="table-​contents"><table·​summary="Often·​used·​RGB·​combinations"·​border="0"><colgroup>​<col·​class="c1"><col></​colgroup><tbody><tr><​td><strong·​class="userinput"><co​de>0,​0,​0</​code></​strong></​td><td>black</​td></​tr><tr><td><strong·​class="userinput"><co​de>255,​255,​255</​code></​strong></​td><td>white</​td></​tr><tr><td><strong·​class="userinput"><co​de>255,​0,​0</​code></​strong></​td><td>red</​td></​tr><tr><td><strong·​class="userinput"><co​de>150,​0,​0</​code></​strong></​td><td>dark·​red</​td></​tr><tr><td><strong·​class="userinput"><co​de>0,​255,​0</​code></​strong></​td><td>green</​td></​tr><tr><td><strong·​class="userinput"><co​de>0,​0,​255</​code></​strong></​td><td>blue</​td></​tr><tr><td><strong·​class="userinput"><co​de>0,​255,​255</​code></​strong></​td><td>light·​blue</​td></​tr><tr><td><strong·​class="userinput"><co​de>255,​0,​255</​code></​strong></​td><td>pink</​td></​tr><tr><td><strong·​class="userinput"><co​de>255,​255,​0</​code></​strong></​td·​✂380 </​p><div·​class="table"><a·​name="idp150225592"><​/​a><p·​class="title"><b>Tabl​e 5.​2.​ Often·​used·​RGB·​combinations</​b></​p><div·​class="table-​contents"><table·​summary="Often·​used·​RGB·​combinations"·​border="0"><colgroup>​<col·​class="c1"><col></​colgroup><tbody><tr><​td><strong·​class="userinput"><co​de>0,​0,​0</​code></​strong></​td><td>black</​td></​tr><tr><td><strong·​class="userinput"><co​de>255,​255,​255</​code></​strong></​td><td>white</​td></​tr><tr><td><strong·​class="userinput"><co​de>255,​0,​0</​code></​strong></​td><td>red</​td></​tr><tr><td><strong·​class="userinput"><co​de>150,​0,​0</​code></​strong></​td><td>dark·​red</​td></​tr><tr><td><strong·​class="userinput"><co​de>0,​255,​0</​code></​strong></​td><td>green</​td></​tr><tr><td><strong·​class="userinput"><co​de>0,​0,​255</​code></​strong></​td><td>blue</​td></​tr><tr><td><strong·​class="userinput"><co​de>0,​255,​255</​code></​strong></​td><td>light·​blue</​td></​tr><tr><td><strong·​class="userinput"><co​de>255,​0,​255</​code></​strong></​td><td>pink</​td></​tr><tr><td><strong·​class="userinput"><co​de>255,​255,​0</​code></​strong></​td·​✂
381 </​p><p>Two·​commands·​need·​an·​RGB·​combination·​as·​input:​·​these·​commands·​are·​<strong·​class="userinput"><co​de>canvascolor</​code></​strong>·​and·​<strong·​class="userinput"><co​de>pencolor</​code></​strong>.​</​p></​dd><dt><a·​name="sprite"></​a>sprite</​dt><dd><p>A·​sprite·​is·​a·​small·​picture·​that·​can·​be·​moved·​around·​the·​screen.​·​Our·​beloved·​turtle,​·​for·​instance,​·​is·​a·​sprite.​</​p><p>Note:​·​with·​this·​version·​of·​<span·​class="application">K​Turtle</​span>·​the·​sprite·​cannot·​be·​changed·​from·​a·​turtle·​into·​something·​else.​·​Future·​versions·​of·​<span·​class="application">K​Turtle</​span>·​will·​be·​able·​to·​do·​this.​</​p></​dd></​dl></​div></​div></​div><div·​id="footer"><div·​class="navCenter"><ta​ble·​class="navigation"><t​r><td·​class="prevCell"><a·​accesskey="p"·​href="learn.​html">Prev</​a></​td><td·​class="upCell"><a·​accesskey="h"·​href="index.​html">Contents</​a></​td><td·​class="nextCell"><a·​accesskey="n"·​href="translators.​html">Next</​a></​td></​tr><tr><td·​class="prevCell">Crea​te·​your·​own·​commands·​with·​<span·​class="quote">“<span·​class="quote">learn</​span>”</​span> </​td>·​✂381 </​p><p>Two·​commands·​need·​an·​RGB·​combination·​as·​input:​·​these·​commands·​are·​<strong·​class="userinput"><co​de>canvascolor</​code></​strong>·​and·​<strong·​class="userinput"><co​de>pencolor</​code></​strong>.​</​p></​dd><dt><a·​name="sprite"></​a>sprite</​dt><dd><p>A·​sprite·​is·​a·​small·​picture·​that·​can·​be·​moved·​around·​the·​screen.​·​Our·​beloved·​turtle,​·​for·​instance,​·​is·​a·​sprite.​</​p><p>Note:​·​with·​this·​version·​of·​<span·​class="application">K​Turtle</​span>·​the·​sprite·​cannot·​be·​changed·​from·​a·​turtle·​into·​something·​else.​·​Future·​versions·​of·​<span·​class="application">K​Turtle</​span>·​will·​be·​able·​to·​do·​this.​</​p></​dd></​dl></​div></​div></​div><div·​id="footer"><div·​class="navCenter"><ta​ble·​class="navigation"><t​r><td·​class="prevCell"><a·​accesskey="p"·​href="learn.​html">Prev</​a></​td><td·​class="upCell"><a·​accesskey="h"·​href="index.​html">Contents</​a></​td><td·​class="nextCell"><a·​accesskey="n"·​href="translators.​html">Next</​a></​td></​tr><tr><td·​class="prevCell">Crea​te·​your·​own·​commands·​with·​<span·​class="quote">“<span·​class="quote">learn</​span>”</​span> </​td>·​✂
382 <span·​class="application">K​Turtle</​span>382 <span·​class="application">K​Turtle</​span>
383 </​p><p>Software·​copyright·​2003-​2007·​Cies·​Breijs·​<code·​class="email">(cies·​AT·​kde·​DOT·​nl)​</​code></​p><p>Documentation·​copyright·​2004,​·​2007,​·​2009383 </​p><p>Software·​copyright·​2003-​2007·​Cies·​Breijs·​<code·​class="email">(cies·​AT·​kde·​DOT·​nl)​</​code></​p><p>Documentation·​copyright·​2004,​·​2007,​·​2009
384 </​p><div·​class="itemizedlist">​<ul·​class="itemizedlist"·​type="disc"><li·​class="listitem"><p>384 </​p><div·​class="itemizedlist">​<ul·​class="itemizedlist"·​type="disc"><li·​class="listitem"><p>
385 Cies·​Breijs·​<code·​class="email">(cies·​AT·​kde·​DOT·​nl)​</​code>385 Cies·​Breijs·​<code·​class="email">(cies·​AT·​kde·​DOT·​nl)​</​code>
386 </​p></​li><li·​class="listitem"><p>386 </​p></​li><li·​class="listitem"><p>
387 <span·​class="firstname">Ann​e-​Marie</​span>·​<span·​class="surname">Mahfo​uf</​span>·​<code·​class="email">(annma·​AT·​kde·​DOT·​org)​</​code>387 <span·​class="firstname">Ann​e-​Marie</​span>·​<span·​class="surname">Mahfo​uf</​span>·​<code·​class="email">(annma·​AT·​kde·​DOT·​org)​</​code>