Difference between revisions of "KTurtle/C2/Introduction-to-KTurtle/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with '[http://spoken-tutorial.org/wiki/images/9/9e/Resources-Introduction_to_KTurtle.zip Resources for "Introduction to KTurtle"] {| style="border-spacing:0;" | style="border-top:0.00…')
 
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
[http://spoken-tutorial.org/wiki/images/9/9e/Resources-Introduction_to_KTurtle.zip Resources for "Introduction to KTurtle"]
+
Title of the tutorial: Introduction-to-KTurtle
  
{| style="border-spacing:0;"
+
Author: ITfC Bangaluru
| style="border-top:0.002cm solid #000000;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;"| <center>'''Visual Cue'''</center>
+
| style="border:0.002cm solid #000000;padding:0.097cm;"| <center>'''Narration'''</center>
+
  
 +
Key words:  KTurtle Window, Editor, Canvas, Menu Bar, Toolbar, TurtleScript, Turtle, Full speed(No highlighting and inspector), Full speed, Slow, Slower, Slowest and Step-by-Step, Abort, pause, Video tutorial.
 +
 +
{|border =1
 +
!Visual Cue
 +
!Narration
 
|-
 
|-
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;"| <center>Show slide number 1</center>
+
||'''Slide Number 1'''
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;"| Hello Everybody
+
  
 +
'''Title slide'''
 +
||Hello everybody.
  
Welcome to the tutorial Introduction to KTurtle.  
+
Welcome to this tutorial on '''Introduction to KTurtle.'''
  
 +
In this tutorial I will introduce you to the basics of getting started with '''KTurtle.'''
 +
|-
 +
||Slide number2
  
In this tutorial I will introduce you to the basics of getting started with KTurtle.
+
'''Learning objectives'''
 +
||In this tutorial,  we will learn about
  
|-
+
* KTurtle Window
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;"| <center>Switch to slide number 2</center>
+
  
<center>(What is KTurtle?) </center>
+
* Editor
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;"| What is KTurtle ?
+
  
 +
* Canvas
  
It is a free programming software
+
* Menu Bar
  
 +
* Toolbar
  
and is available at [http://edu.kde.org/kturtle/ http://edu.kde.org/kturtle/] for download.
+
We will also learn about,
 
+
  
 +
* Moving the '''Turtle'''
  
 +
* Drawing '''lines and changing directions'''
  
 +
* Draw a '''triangle'''
 
|-
 
|-
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;"| <center>Switch to Slide number 3</center>
+
||'''Slide Number 3'''
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;"| * It is useful for computer aided learning <br/>
+
 
+
* as it is interactive, and it makes programming easy and accessible.<br/>
+
 
+
* It helps teach kids the basics of maths, geometry and programming.<br/>
+
 
+
* It translates commands into the speaking language of the programmer.
+
  
 +
'''System Requirement'''
 +
||To record this tutorial I am using
  
 +
Ubuntu Linux OS version. 12.04.
  
 +
KTurtle version. 0.8.1 beta.
 
|-
 
|-
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;"| <center>Switch to slide number 4 </center>
+
||Slide Number 4
  
<center>(Lesson Outline)</center>
+
What is  KTurtle?
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;"| * To get started with KTurtle, <br/>
+
||What is KTurtle?
  
* I am using the Linux operating system Edubuntu, Version 11.04
+
'''KTurtle''' is a '''free tool''' to learn basic programming.  
* and KTurtle Version 0.8.1 Beta
+
  
 +
It is useful for '''computer aided interactive learning'''
  
 +
'''KTurtle''' is  available for download at
  
 +
'''http://edu.kde.org/kturtle/'''
 
|-
 
|-
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;"| <center>Switch to Desktop to Open KTurtle</center>
+
||Slide  Number 5
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;"| If you have already installed KTurtle, go to the Ubuntu Menu Item '''Applications >''' '''Education''' or '''Science'''
+
  
 +
Utilities of KTurtle
 +
||KTurtle
  
and click on the '''KTurtle''' Application.  
+
* Makes programming '''easy''' and '''accessible .'''
  
 +
* Helps teach kids '''basics of mathematics.'''
  
If you have not installed KTurtle,
+
* Translates commands to '''speaking language''' of the programmer
  
 +
* Translates commands into '''visuals.'''
 +
|-
 +
||Slide  Number 6
 +
Install KTurtle
 +
||* We can install  '''KTurtle''' using '''Synaptic Package Manager .'''
  
go to '''System''' > '''Administration >''' '''Synaptic Package Manager''' to install '''KTurtle'''.
+
* for more information on '''Synaptic Package Manager  
 +
'''
 +
* please refer to '''Ubuntu Linux''' tutorials on our website
  
 +
'''http://spoken-tutorial.org'''
 +
|-
 +
||Switch to KTurtle Application
  
Search for the package '''kturtle, mark it for installation and click Apply.'''
+
Dash home >>In the Search bar>>
  
 +
Type KTurtle  Click on the KTurtle icon.
 +
||Let's open a new '''KTurtle''' Application.
  
To know more about how to use '''Synaptic Package Manager, '''you can refer the following link –
+
Click on '''Dash home'''
  
[http://spoken-tutorial.org/Linux2_Ubuntu_Synaptic_Package_Manager_English http://spoken-tutorial.org/Linux2_Ubuntu_Synaptic_Package_Manager_English]
+
In the Search bar, type '''KTurtle.'''
  
 +
And Click on the '''KTurtle''' icon.
 +
|-
 +
||
 +
Switch to KTurtle Application
  
Another way to open KTurtle in Ubuntu 11.04
+
Move the mouse over the window
 +
||A typical KTurtle window looks like this.  
  
 +
This is the '''Menubar'''.
  
is by going to '''Applications > Accessories > Terminal'''
+
In the menu bar on the top,
  
 +
You will find menu items 
  
and at the prompt type “kturtle” and hit 'Enter' this will open the application.  
+
'''File, Edit, Canvas, Run, Tools, Settings''' and '''help''' options
 +
|-
 +
||Tool bar
 +
||In the tool bar, you can reach for most of the actions used.
 +
|-
 +
||Editor
 +
||'''Editor''' is on the left, where you can type the '''TurtleScript''' commands.  
  
 +
Most of the functions of the editor can be found in the  '''File''' and '''Edit''' menus.
 
|-
 
|-
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;"| <center>Switch back to Slide 4</center>
+
||How to write code in the editor
 +
||There are several ways to enter the code in the editor.
  
<center>(Lesson Outline)</center>
+
Easiest way is to use an example.  
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;"| Let us explore the '''KTurtle''' window .  
+
  
 +
Go to  '''File''' menu > select  '''Examples'''
  
In this tutorial, I will briefly explain
+
Here I will select a '''flower'''
  
 +
Code of the selected example opens in the editor.
  
'''the editor,''' '''the canvas, the menubar, and the toolbar '''
+
Click on the '''Run''' button  from '''Menu bar''' or ''' Tool bar''' to run the code.
  
 +
Another way is to directly type your own code in the editor
  
and also the input commands.
+
or copy/paste some code in the editor
  
 +
for example:  from other '''KTurtle''' files
 
|-
 
|-
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;"| <center>Switch to KTurtle Application</center>
+
||Show the Canvas
 +
||Canvas is on the right, where '''Turtle''' makes your drawings.  
  
 +
'''Turtle''' draws accordingly to the commands it gets from the editor on the canvas
 +
|-
 +
||Run options.
 +
||'''Run''' option on the tool bar starts ''' execution''' of the commands in the editor.
  
<center>to explain the window</center>
+
It presents a list of execution speeds.  
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;"| A typical KTurtle window looks like this.  
+
  
 +
'''Full speed(No highlighting and inspector),'''
  
It has –
+
'''Full speed,'''
  
 +
'''Slow,'''
  
in the '''menu bar '''on the top''', '''you will find the '''file, edit, canvas, run, tools, settings '''and '''help '''options
+
'''Slower,'''  
  
 +
'''Slowest''' and
  
in the '''tool bar, '''you can reach for the most used actions.
+
'''Step-by-Step'''  
  
 +
'''Abort''' and  '''pause''' options allow you to stop and pause the executions respectively.
 +
|-
 +
||
 +
||Let's now '''Run''' this code .
  
the '''editor '''is on the left, where you type the TurtleScript commands.
+
'''Turtle''' draws a '''flower''' on the canvas.
 +
|-
 +
||Show position of the Turtle
 +
||When you open a new '''KTurtle''' application.
  
 +
'''Turtle''' is in the middle of the canvas by '''default.'''
  
most of the functions of the editor can be found in the '''file '''and '''edit '''menus.
+
Let's now move the '''Turtle.'''
  
 +
'''Turtle''' can do three types of moves:
  
there are several ways to enter the code in the editor.
+
It can move forwards. It can move backwards
  
 +
It can turn left or right.
  
Easiest way is to use an example.
+
It can also jump directly to a position on the screen.  
 +
|-
 +
||Zoom text
 +
||Let me zoom into the program text it may possibly be a little blurred.
 +
|-
 +
||Type code in the editor
  
 +
'''reset'''
  
Go to the '''file '''menu > '''examples''' and select an example.
+
'''forward 100'''  
  
 +
'''turnleft 120'''
  
The chosen example will be opened in the editor.
+
'''forward 100'''
  
 +
'''turnleft 120'''
  
You can select '''run '''from the menu bar or the tool bar to run the code.
+
'''forward 100'''  
  
 +
'''turnleft 120'''
 +
||Let us go through a simple example.
  
Another way is to directly type your own code
+
In your editor, type the following commands:
  
 +
'''reset ''' 
  
or copy/paste some code in the editor
+
'''forward 100'''
  
 +
'''turnright 120 '''
  
(for example, from other kturtle files)
+
'''forward  100'''
 
+
  
 +
'''turnright  120'''
  
 +
'''forward 100'''
  
 +
'''turnright  120'''
 
|-
 
|-
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;"|  
+
||Highlighting
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;"| The canvas is on the right, where the turtle makes your drawing.
+
||Note that the color of the code changes as we type .  
  
 +
This feature is called '''highlighting.'''
  
The turtle draws accordingly to the commands it gets from the editor.
+
Different types of commands are highlighted differently,
  
 +
which makes it easier to read '''large blocks''' of code.
 
|-
 
|-
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;"|  
+
||
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;"| The '''run '''option in the tool bar starts the execution of the commands in the editor.
+
||I will explain the code now.  
 +
|-
 +
||Explanation of code
 +
||'''reset''' command sets Turtle to  '''default''' position.  
  
 +
'''forward 100''' commands Turtle to move forward by '''100 pixels.'''
  
It presents a list of possible execution speeds.
+
'''turnright 120'''  commands '''Turtle''' to turn, '''120 degrees anti-clockwise'''.  
  
 +
Note that these two commands are repeated thrice to draw a triangle.
 +
|-
 +
||Run the code
 +
||Let's now execute the code.
  
'''Full speed, slow, slower, slowest and step-by-Step'''
+
I will choose ''' Slow''' step so that we understand what commands  are being executed.
  
 +
Here the triangle is drawn.
 +
|-
 +
||“repeat” command
 +
||Let's look at another example and also learn how to beautify our canvas.
  
the '''abort '''and the '''pause '''options allow you to stop and pause the executions respectively
+
Let's draw a triangle using ''' repeat''' command.
  
 +
I will clear the current program.
 
|-
 
|-
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;"| <center>Switch back to Slide 4</center>
+
||Zoom text
 
+
||Let me zoom into the program text to have a clear view.
<center>(Lesson Outline)</center>
+
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;"| In this tutorial we will see
+
 
+
 
+
'''moving the turtle'''
+
 
+
 
+
'''how to draw lines and '''
+
 
+
 
+
'''changing directions'''.  
+
 
+
 
|-
 
|-
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;"| <center>KTurtle Window</center>
+
||'''reset'''
  
<center>Using the Tool</center>
+
'''canvassize 200,200'''  
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;"| When you open '''KTurtle, '''
+
  
 +
'''canvascolor 0,255,0'''
  
the turtle is in the middle of the canvas by default.
+
'''pencolor 0,0,255'''
  
 +
'''penwidth 2'''
  
Let us start by getting the turtle to move.
+
'''repeat 3 {'''
  
 +
'''forward 100'''
  
The '''turtle '''can do three types of moves:
+
'''turnleft 120'''  
 +
}
 +
||Type the following commands into your editor:  
  
it can move forwards and backwards
+
'''reset'''
  
 +
'''canvassize space 200,200 '''
  
it can turn left and right; and
+
'''canvascolor space 0,255,0''' 
  
 +
'''pencolor space 0,0,255''' 
  
it can go (or jump) directly to a position on the screen.
+
'''penwidth  space  2'''
  
 +
'''repeat'''  space  '''3'''  within curly braces {
  
Let us go through a simple example.
+
'''forward 100'''
  
 +
'''turnleft  120'''
 +
}
 +
|-
 +
||
 +
||Let me now explain the code.
 +
|-
 +
||Highlight reset
 +
||'''reset''' command sets '''Turtle''' to its '''default''' position.
 +
|-
 +
||Highlight canvassize 200,200
 +
||'''canvassize 200,200''' sets the canvas width and height to 200 pixels.
 +
|-
 +
||Highlight canvascolor 0,255,0
 +
||'''canvascolor 0,255,0'''  makes the canvas ''' green.'''
  
In your '''editor''', type the following commands:
+
'''0,255,0''' is a '''RGB''' Combination  where only the green value is set to '''255'''
 +
and  the others are set to '''0'''.
  
 +
This makes the canvas  '''green''' in color.
 +
|-
 +
||Highlight pencolor 0,0,255
 +
||'''pencolor 0,0,255''' sets the color of  pen to blue.
  
'''reset'''
+
'''RGB''' combination where blue value is set to '''255.'''  
 
+
|-
'''forward 100'''
+
||Highlight penwidth 2
 
+
||'''penwidth 2''' sets the width of the pen to 2 ''' pixels'''.  
'''turnleft 120'''
+
|-
 
+
||Highlight repeat
'''forward 100'''
+
||'''repeat''' command is followed by a number  
 
+
'''turnleft 120'''
+
 
+
'''forward 100'''
+
 
+
'''turnleft 120'''
+
 
+
 
+
Also, note that the color of the code changes as we type it.
+
 
+
 
+
This feature is called the '''''highlighting –'''''
+
 
+
 
+
different types of commands are highlighted differently,
+
 
+
 
+
which makes it easier to read large blocks of code.
+
 
+
 
+
I am now clicking on '''run '''to execute the code
+
 
+
 
+
''I will choose the '''Slower '''option so that we understand what commands are being executed.''
+
 
+
 
+
The '''reset '''command sets the turtle to the '''default position.'''
+
 
+
 
+
The '''forward 100 '''command instructs the turtle to move forward by 100 pixels.
+
 
+
 
+
The '''turnleft 120 '''instructs the turtle to turn to the left ,anti-clockwise by 120 degrees.
+
 
+
 
+
'''Note that these two commands are repeated three times and a triangle is drawn.'''
+
 
+
 
+
Lets look at another example and also how to beautify our canvas:
+
 
+
 
+
'''We will now draw a triangle using a repeat command'''
+
 
+
 
+
'''''A Simple Example: To draw a triangle'''''
+
 
+
 
+
Type the following commands in the editor:
+
 
+
 
+
'''reset'''
+
 
+
'''canvassize 200,200'''
+
 
+
'''canvascolor 112,179,0'''
+
 
+
'''pencolor 0,0,255'''
+
 
+
'''penwidth 2'''
+
 
+
'''repeat 3 {'''
+
 
+
'''forward 100'''
+
 
+
'''turnleft 120'''
+
 
+
'''}'''
+
 
+
 
+
Click on '''Run '''now.
+
 
+
 
+
I have selected the '''slower '''option here again to run the commands.
+
 
+
 
+
The '''reset '''command sets the turtle to the '''default position.'''
+
 
+
 
+
The '''canvassize 200,200 '''sets the canvas width and height to 200 pixels
+
 
+
 
+
(here width=height, so the canvas is a square).
+
 
+
 
+
The '''canvascolor 0,255,0 '''makes the canvas '''green. '''
+
 
+
 
+
0,255,0 is a '''RGB (Red-Green-Blue)-Combination '''where only the '''green '''value is set to '''255 (fully on)'''
+
 
+
 
+
and the others are set to '''0 (fully off) ''',
+
 
+
 
+
which results in the canvas being in green color.
+
 
+
 
+
The '''pencolor 0,0,255 '''sets the color of the pen to '''blue '''
+
 
+
 
+
'''('''RGB combination where black value is set to 255).
+
 
+
 
+
The '''penwidth 2 '''sets the the width (i.e. the size) of the pen to 3 pixels.  
+
 
+
 
+
The '''repeat '''command is followed by a number  
+
 
+
  
 
and a list of commands within curly brackets.  
 
and a list of commands within curly brackets.  
 
  
 
This repeats the commands within the curly brackets the specified number of times.  
 
This repeats the commands within the curly brackets the specified number of times.  
 +
|-
 +
||
 +
Highlight  '''forward 100''' and '''turnleft 120'''
 +
||Here the commands '''forward 100''' and '''turnleft 120''' are within curly brackets.
  
 +
'''repeat''' command is followed by the number '''3''', because a triangle has 3 sides.
  
Here the commands '''forward 100 '''and '''turnleft 120 '''are within curly brackets
+
These commands are run 3 times in a '''loop'''.
  
 +
3 sides of the triangle are drawn.
 +
|-
 +
||Run the program
 +
||Let's Run the code now
  
and the repeat command is followed by the number 3 (because a triangle has 3 sides).
+
I will select '''slow'''  option for execution of the program.  
 
+
 
+
These commands are run 3 times in a loop
+
 
+
 
+
and all the 3 sides of the triangle are drawn.
+
  
 +
The canvas color becomes '''green''' and  the''' Turtle''' draws a triangle.
 
|-
 
|-
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;"| <center>KTurtle Window -Saving and Opening a File</center>
+
||Save file
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;"| To save a file,
+
||Let's now save the file.
  
 +
Select '''File''' menu > '''Save As '''
  
select menu item F'''ile > Save As . '''
+
'''Save As''' dialog box opens.
  
 +
I will select '''Document''' folder for  saving the file.
  
I will select the '''Documents''' folder,
+
I will type the file name as '''Triangle''' and click on '''Save''' button.
  
 +
Notice that the name of the file appears in the '''top panel''' and it is saved as a dot turtle file like all '''Turtle''' files.
 +
|-
 +
||
 +
||With this we come to the end of this tutorial.
  
then the '''Kturtle '''folder within it.  
+
Let's summarize.
 +
|-
 +
||Slide Number
  
 +
Summary
 +
||In this tutorial, we have learnt about,
  
I will enter the file name as '''triangle''' and click '''Save'''.
+
KTurtle's '''editor, canvas, menubar''' and toolbar
  
 +
* Move Turtle
  
Notice that the name appears in the top panel
+
* Draw '''lines and change directions '''
  
 +
* Draw a '''triangle'''
 +
|-
 +
||Switch to Slide 5
  
and it is saved as a '''.turtle''' file like all KTurtle files.
+
Assignment
 +
||
 +
ASSIGNMENT
  
 +
As an assignment  I would like you to draw a '''square.'''
 +
by using the  commands.
  
Now to open a file, go to '''File > '''Open.
+
* '''forward, backward, turnleft, turnright''' and '''repeat'''  
  
 +
* Set '''background color''', '''penwidth''' and '''pencolor'''  of your choice
  
Select the file to open.
+
* Change values in the ''' RGB''' combination
 
+
 
|-
 
|-
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;"| <center>Switch to Slide 5</center>
+
||Slide number 11
  
<center>(Assignment)</center>
+
Acknowledgement
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;"| Now to the ASSIGNMENT
+
||Watch the video available at this URL
  
 +
http://spoken-tutorial.org/What is a Spoken Tutorial
  
Here I would like you to draw a '''square'''
+
It summarises the Spoken Tutorial project
  
 +
If you do not have good bandwidth, you can download and watch it
 +
|-
 +
||Slide Number 12
 +
||The Spoken Tutorial Project Team :
  
by using the '''commands '''which we have just learnt'''.'''
+
Conducts workshops using spoken tutorials
  
 +
Gives certificates to those who pass an online test
  
That is , '''forward, backward, turnleft, turnright and repeat'''
+
For more details, please write to  
 
+
 
+
Also set the background color, penwidth and pencolor to a color of your choice
+
 
+
 
+
by changing the values in the RGB combination
+
 
+
 
+
as shown in the example earlier.
+
  
 +
'''contact@spoken-tutorial.org'''
 
|-
 
|-
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;"| <center>Switch to Slide 6</center>
+
||Slide number 13
 +
||Spoken Tutorial Project is a part of the Talk to a Teacher project
  
<center>(Acknowledgement)</center>
+
It is supported by the National Mission on Education
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;"| I would like to acknowledge the spoken tutorial project
+
  
 +
through ICT, MHRD, Government of India
  
which is part of the talk to a teacher project.
+
More information on this Mission is available at this link
  
 +
'''http://spoken-tutorial.org/NMEICT-Intro ] '''
  
It is supported by the National Mission on Education through ICT, MHRD government of India.
+
The script is contributed by '''IT for Change Bangaluru'''.
 
+
 
+
And you can see more information about this at this website.  
+
  
 +
This is Madhuri Ganpathi from '''IIT Bombay''' signing off.
 +
Thank you for joining.
 
|-
 
|-
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:none;padding:0.097cm;"| <center>Switch to Slide 7</center>
 
 
<center>(Thank You)</center>
 
| style="border-top:none;border-bottom:0.002cm solid #000000;border-left:0.002cm solid #000000;border-right:0.002cm solid #000000;padding:0.097cm;"| Thank you this is Sindhu signing off. Enjoy exploring KTurtle.
 
 
|}
 

Latest revision as of 15:33, 18 December 2013

Title of the tutorial: Introduction-to-KTurtle

Author: ITfC Bangaluru

Key words: KTurtle Window, Editor, Canvas, Menu Bar, Toolbar, TurtleScript, Turtle, Full speed(No highlighting and inspector), Full speed, Slow, Slower, Slowest and Step-by-Step, Abort, pause, Video tutorial.

Visual Cue Narration
Slide Number 1

Title slide

Hello everybody.

Welcome to this tutorial on Introduction to KTurtle.

In this tutorial I will introduce you to the basics of getting started with KTurtle.

Slide number2

Learning objectives

In this tutorial, we will learn about
  • KTurtle Window
  • Editor
  • Canvas
  • Menu Bar
  • Toolbar

We will also learn about,

  • Moving the Turtle
  • Drawing lines and changing directions
  • Draw a triangle
Slide Number 3

System Requirement

To record this tutorial I am using

Ubuntu Linux OS version. 12.04.

KTurtle version. 0.8.1 beta.

Slide Number 4

What is KTurtle?

What is KTurtle?

KTurtle is a free tool to learn basic programming.

It is useful for computer aided interactive learning

KTurtle is available for download at

http://edu.kde.org/kturtle/

Slide Number 5

Utilities of KTurtle

KTurtle
  • Makes programming easy and accessible .
  • Helps teach kids basics of mathematics.
  • Translates commands to speaking language of the programmer
  • Translates commands into visuals.
Slide Number 6

Install KTurtle

* We can install KTurtle using Synaptic Package Manager .
  • for more information on Synaptic Package Manager

  • please refer to Ubuntu Linux tutorials on our website

http://spoken-tutorial.org

Switch to KTurtle Application

Dash home >>In the Search bar>>

Type KTurtle Click on the KTurtle icon.

Let's open a new KTurtle Application.

Click on Dash home.

In the Search bar, type KTurtle.

And Click on the KTurtle icon.

Switch to KTurtle Application

Move the mouse over the window

A typical KTurtle window looks like this.

This is the Menubar.

In the menu bar on the top,

You will find menu items

File, Edit, Canvas, Run, Tools, Settings and help options

Tool bar In the tool bar, you can reach for most of the actions used.
Editor Editor is on the left, where you can type the TurtleScript commands.

Most of the functions of the editor can be found in the File and Edit menus.

How to write code in the editor There are several ways to enter the code in the editor.

Easiest way is to use an example.

Go to File menu > select Examples

Here I will select a flower

Code of the selected example opens in the editor.

Click on the Run button from Menu bar or Tool bar to run the code.

Another way is to directly type your own code in the editor

or copy/paste some code in the editor

for example: from other KTurtle files

Show the Canvas Canvas is on the right, where Turtle makes your drawings.

Turtle draws accordingly to the commands it gets from the editor on the canvas

Run options. Run option on the tool bar starts execution of the commands in the editor.

It presents a list of execution speeds.

Full speed(No highlighting and inspector),

Full speed,

Slow,

Slower,

Slowest and

Step-by-Step

Abort and pause options allow you to stop and pause the executions respectively.

Let's now Run this code .

Turtle draws a flower on the canvas.

Show position of the Turtle When you open a new KTurtle application.

Turtle is in the middle of the canvas by default.

Let's now move the Turtle.

Turtle can do three types of moves:

It can move forwards. It can move backwards

It can turn left or right.

It can also jump directly to a position on the screen.

Zoom text Let me zoom into the program text it may possibly be a little blurred.
Type code in the editor

reset

forward 100

turnleft 120

forward 100

turnleft 120

forward 100

turnleft 120

Let us go through a simple example.

In your editor, type the following commands:

reset

forward 100

turnright 120

forward 100

turnright 120

forward 100

turnright 120

Highlighting Note that the color of the code changes as we type .

This feature is called highlighting.

Different types of commands are highlighted differently,

which makes it easier to read large blocks of code.

I will explain the code now.
Explanation of code reset command sets Turtle to default position.

forward 100 commands Turtle to move forward by 100 pixels.

turnright 120 commands Turtle to turn, 120 degrees anti-clockwise.

Note that these two commands are repeated thrice to draw a triangle.

Run the code Let's now execute the code.

I will choose Slow step so that we understand what commands are being executed.

Here the triangle is drawn.

“repeat” command Let's look at another example and also learn how to beautify our canvas.

Let's draw a triangle using repeat command.

I will clear the current program.

Zoom text Let me zoom into the program text to have a clear view.
reset

canvassize 200,200

canvascolor 0,255,0

pencolor 0,0,255

penwidth 2

repeat 3 {

forward 100

turnleft 120 }

Type the following commands into your editor:

reset

canvassize space 200,200

canvascolor space 0,255,0

pencolor space 0,0,255

penwidth space 2

repeat space 3 within curly braces {

forward 100

turnleft 120 }

Let me now explain the code.
Highlight reset reset command sets Turtle to its default position.
Highlight canvassize 200,200 canvassize 200,200 sets the canvas width and height to 200 pixels.
Highlight canvascolor 0,255,0 canvascolor 0,255,0 makes the canvas green.

0,255,0 is a RGB Combination where only the green value is set to 255 and the others are set to 0.

This makes the canvas green in color.

Highlight pencolor 0,0,255 pencolor 0,0,255 sets the color of pen to blue.

RGB combination where blue value is set to 255.

Highlight penwidth 2 penwidth 2 sets the width of the pen to 2 pixels.
Highlight repeat repeat command is followed by a number

and a list of commands within curly brackets.

This repeats the commands within the curly brackets the specified number of times.

Highlight forward 100 and turnleft 120

Here the commands forward 100 and turnleft 120 are within curly brackets.

repeat command is followed by the number 3, because a triangle has 3 sides.

These commands are run 3 times in a loop.

3 sides of the triangle are drawn.

Run the program Let's Run the code now

I will select slow option for execution of the program.

The canvas color becomes green and the Turtle draws a triangle.

Save file Let's now save the file.

Select File menu > Save As

Save As dialog box opens.

I will select Document folder for saving the file.

I will type the file name as Triangle and click on Save button.

Notice that the name of the file appears in the top panel and it is saved as a dot turtle file like all Turtle files.

With this we come to the end of this tutorial.

Let's summarize.

Slide Number

Summary

In this tutorial, we have learnt about,

KTurtle's editor, canvas, menubar and toolbar

  • Move Turtle
  • Draw lines and change directions
  • Draw a triangle
Switch to Slide 5

Assignment

ASSIGNMENT

As an assignment I would like you to draw a square. by using the commands.

  • forward, backward, turnleft, turnright and repeat
  • Set background color, penwidth and pencolor of your choice
  • Change values in the RGB combination
Slide number 11

Acknowledgement

Watch the video available at this URL

http://spoken-tutorial.org/What is a Spoken Tutorial

It summarises the Spoken Tutorial project

If you do not have good bandwidth, you can download and watch it

Slide Number 12 The Spoken Tutorial Project Team :

Conducts workshops using spoken tutorials

Gives certificates to those who pass an online test

For more details, please write to

contact@spoken-tutorial.org

Slide number 13 Spoken Tutorial Project is a part of the Talk to a Teacher project

It is supported by the National Mission on Education

through ICT, MHRD, Government of India

More information on this Mission is available at this link

http://spoken-tutorial.org/NMEICT-Intro ]

The script is contributed by IT for Change Bangaluru.

This is Madhuri Ganpathi from IIT Bombay signing off. Thank you for joining.

Contributors and Content Editors

Chandrika, Madhurig