<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=KTurtle%2FC2%2FGrammar-of-TurtleScript-Part-I%2FEnglish</id>
		<title>KTurtle/C2/Grammar-of-TurtleScript-Part-I/English - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=KTurtle%2FC2%2FGrammar-of-TurtleScript-Part-I%2FEnglish"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=KTurtle/C2/Grammar-of-TurtleScript-Part-I/English&amp;action=history"/>
		<updated>2026-04-09T01:35:32Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=KTurtle/C2/Grammar-of-TurtleScript-Part-I/English&amp;diff=989&amp;oldid=prev</id>
		<title>Pravin1389: moved KTurtle/C2/Grammar-of-TurtleScript-Part-I /English to KTurtle/C2/Grammar-of-TurtleScript-Part-I/English</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=KTurtle/C2/Grammar-of-TurtleScript-Part-I/English&amp;diff=989&amp;oldid=prev"/>
				<updated>2012-12-02T09:00:21Z</updated>
		
		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/index.php/KTurtle/C2/Grammar-of-TurtleScript-Part-I_/English&quot; class=&quot;mw-redirect&quot; title=&quot;KTurtle/C2/Grammar-of-TurtleScript-Part-I /English&quot;&gt;KTurtle/C2/Grammar-of-TurtleScript-Part-I /English&lt;/a&gt; to &lt;a href=&quot;/index.php/KTurtle/C2/Grammar-of-TurtleScript-Part-I/English&quot; title=&quot;KTurtle/C2/Grammar-of-TurtleScript-Part-I/English&quot;&gt;KTurtle/C2/Grammar-of-TurtleScript-Part-I/English&lt;/a&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 09:00, 2 December 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan='2' style='text-align: center;'&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Pravin1389</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=KTurtle/C2/Grammar-of-TurtleScript-Part-I/English&amp;diff=135&amp;oldid=prev</id>
		<title>Chandrika: Created page with '[http://spoken-tutorial.org/wiki/images/4/4b/Resources-Grammar_of_KTurtleScript_Part_I.zip Resources for &quot;Grammar of TurtleScript Part I&quot;]  {| style=&quot;border-spacing:0;&quot; | style=&quot;…'</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=KTurtle/C2/Grammar-of-TurtleScript-Part-I/English&amp;diff=135&amp;oldid=prev"/>
				<updated>2012-11-27T12:00:18Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;[http://spoken-tutorial.org/wiki/images/4/4b/Resources-Grammar_of_KTurtleScript_Part_I.zip Resources for &amp;quot;Grammar of TurtleScript Part I&amp;quot;]  {| style=&amp;quot;border-spacing:0;&amp;quot; | style=&amp;quot;…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[http://spoken-tutorial.org/wiki/images/4/4b/Resources-Grammar_of_KTurtleScript_Part_I.zip Resources for &amp;quot;Grammar of TurtleScript Part I&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border-top:0.002cm solid #000000;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| &amp;lt;center&amp;gt;'''Visual Cue'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:0.002cm solid #000000;padding:0.097cm;&amp;quot;| &amp;lt;center&amp;gt;'''Narration'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| Show Slide 1&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;&amp;quot;| Hello Everybody. Welcome to the KTurtle tutorial &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If this is the first time you are using KTurtle, please see the “Introduction to KTurtle” tutorial on the spoken tutorial website.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| Slide 2&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;&amp;quot;| To get started with KTurtle, I am using the Linux operating system Edubuntu Version 11.04 and KTurtle version 0.8.1 beta.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial will help you understand further, the '''Grammar of TurtleScript'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| Switch to Terminal window&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;&amp;quot;| If you have already installed KTurtle, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
go to the Ubuntu Menu Item '''Applications &amp;gt;''' '''Education''' or '''Science''' &lt;br /&gt;
&lt;br /&gt;
and click on the '''KTurtle''' Application. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to open KTurtle in Ubuntu 11.04 is by going to '''Applications &amp;gt; Accessories &amp;gt; Terminal''' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and at the prompt type “'''kturtle'''” and hit 'Enter'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This will open the application. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;&amp;quot;| In this tutorial, we will learn, the grammar of turtle script which includes,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* commands and comments&lt;br /&gt;
* numbers, variables and strings&lt;br /&gt;
* mathematical and comparison operators &lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
* the boolean values&lt;br /&gt;
&lt;br /&gt;
* the '''if '''and '''else '''conditions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;&amp;quot;| The '''TurtleScript '''is a programming language and has different types of words and symbols. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They are used for different purposes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And it is used to instruct KTurtle what to do.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The grammar of TurtleScript can include '''comments, commands, numbers, strings etc.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;&amp;quot;| '''Numbers'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Numbers can be used in ''mathematical operators ''and ''comparison operators.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They can also be stored in variables.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| Switch to KTurtle window&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;&amp;quot;| First we have a look at variables, then we look at assigning values to those variables. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Variables are words that start with a ‘'''$'''’, for example '''$a'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the editor they are highlighted with purple. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the assignment, '''&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;''', a variable is given its content. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Variables can contain any number, string or boolean (true/false) value. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It will keep that content until the program finishes executing or until the variable is reassigned to something else. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can use variables, once assigned, just as if they are their content. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, consider the code being typed in the '''editor'''.&lt;br /&gt;
&lt;br /&gt;
'''$a = 2004 '''&lt;br /&gt;
&lt;br /&gt;
'''$b = 25 '''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''print $a + $b '''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
First the variable '''$a''' is assigned to the value 2004.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next variable '''$b '''is assigned to the value 20.''' '''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''print''' command is used to command the turtle to write something on the canvas. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''print '''takes numbers and strings as input. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''print $a + $b '''add the two values and the turtle prints the value 2024.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;&amp;quot;| Let us next see the Mathematical and Comparison Operators.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the basic mathematical operators '''+, - , * , / '''&lt;br /&gt;
&lt;br /&gt;
Consider the following piece of code –&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''reset'''&lt;br /&gt;
&lt;br /&gt;
'''canvassize 200,200'''&lt;br /&gt;
&lt;br /&gt;
'''$add = 1 + 1'''&lt;br /&gt;
&lt;br /&gt;
'''$subtract = 20 - 5'''&lt;br /&gt;
&lt;br /&gt;
'''$multiply = 15 * 2'''&lt;br /&gt;
&lt;br /&gt;
'''$divide = 30 /30'''&lt;br /&gt;
&lt;br /&gt;
'''go 10,10'''&lt;br /&gt;
&lt;br /&gt;
'''print $add'''&lt;br /&gt;
&lt;br /&gt;
'''go 50,50'''&lt;br /&gt;
&lt;br /&gt;
'''print $subtract'''&lt;br /&gt;
&lt;br /&gt;
'''go 100,100'''&lt;br /&gt;
&lt;br /&gt;
'''print $multiply'''&lt;br /&gt;
&lt;br /&gt;
'''go 175,175'''&lt;br /&gt;
&lt;br /&gt;
'''print $divide'''&lt;br /&gt;
&lt;br /&gt;
'''go 0,0'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;&amp;quot;| The values resulting from the mathematical operations get assigned to various variables. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;&amp;quot;| Let us consider the following simple comparison. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''$answer = 10 &amp;gt; 3'''&lt;br /&gt;
&lt;br /&gt;
'''print $answer'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here 10 is compared to 3 with the ’'''greater than'''’ operator.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The result of this comparison, the boolean value true is stored in the variable '''$answer, '''and the value '''true '''is printed.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;&amp;quot;| Now lets see how Strings work in this application –&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Strings can be put in variables, just like numbers. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Strings cannot be used in mathematical operators or comparison operators. Strings are highlighted with red. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Strings start and end with the '''''''' mark, by these marks KTurtle knows it is a string. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;&amp;quot;| '''Boolean Values'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are only two boolean values: ''true ''and ''false''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example –&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''$answer = 10 &amp;gt; 3'''&lt;br /&gt;
&lt;br /&gt;
'''print $answer'''&lt;br /&gt;
&lt;br /&gt;
'''go 0,0'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the variable ''$answer ''is set to ''true ''because 10 is larger than 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;&amp;quot;| '''Execute 'if' '''and ''''else''''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the code that is placed between the brackets will only be executed ''if ''the ''boolean value ''evaluates 'true'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code between the brackets after ''else ''is only executed if the ''if ''condition is false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example – &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''reset '''&lt;br /&gt;
&lt;br /&gt;
'''$x = 4 '''&lt;br /&gt;
&lt;br /&gt;
'''if $x &amp;gt; 5 { '''&lt;br /&gt;
&lt;br /&gt;
'''print &amp;quot; $x is greater than five !&amp;quot; '''&lt;br /&gt;
&lt;br /&gt;
'''} else { '''&lt;br /&gt;
&lt;br /&gt;
'''print &amp;quot; $x is smaller than six !&amp;quot; '''&lt;br /&gt;
&lt;br /&gt;
'''} '''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;&amp;quot;| Now to the Assignment part.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the '''if '''and '''else '''conditions, the '''mathematical operators''', solve an equation and print the results using the '''print '''and '''go (to print the results on different places on the canvas) '''command.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;&amp;quot;| I would like to acknowledge the spoken tutorial project &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
which is part of the talk to a teacher project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is supported by the National Mission on Education through ICT, MHRD government of India.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And you can see more information about this at this website. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;&amp;quot;| Thank you this is Sindhu signing off. Enjoy exploring KTurtle.&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Chandrika</name></author>	</entry>

	</feed>