KTurtle/C2/Introduction-to-KTurtle/English

From Script | Spoken-Tutorial
Revision as of 17:29, 27 November 2012 by Chandrika (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Resources for "Introduction to KTurtle"

Visual Cue
Narration
Show slide number 1
Hello Everybody


Welcome to the tutorial Introduction to KTurtle.


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

Switch to slide number 2
(What is KTurtle?)
What is KTurtle ?


It is a free programming software


and is available at http://edu.kde.org/kturtle/ for download.



Switch to Slide number 3
* It is useful for computer aided learning
  • as it is interactive, and it makes programming easy and accessible.
  • It helps teach kids the basics of maths, geometry and programming.
  • It translates commands into the speaking language of the programmer.


Switch to slide number 4
(Lesson Outline)
* To get started with KTurtle,
  • I am using the Linux operating system Edubuntu, Version 11.04
  • and KTurtle Version 0.8.1 Beta


Switch to Desktop to Open KTurtle
If you have already installed KTurtle, go to the Ubuntu Menu Item Applications > Education or Science


and click on the KTurtle Application.


If you have not installed KTurtle,


go to System > Administration > Synaptic Package Manager to install KTurtle.


Search for the package kturtle, mark it for installation and click Apply.


To know more about how to use Synaptic Package Manager, you can refer the following link –

http://spoken-tutorial.org/Linux2_Ubuntu_Synaptic_Package_Manager_English


Another way to open KTurtle in Ubuntu 11.04


is by going to Applications > Accessories > Terminal


and at the prompt type “kturtle” and hit 'Enter' this will open the application.

Switch back to Slide 4
(Lesson Outline)
Let us explore the KTurtle window .


In this tutorial, I will briefly explain


the editor, the canvas, the menubar, and the toolbar


and also the input commands.

Switch to KTurtle Application


to explain the window
A typical KTurtle window looks like this.


It has –


in the menu bar on the top, you will find the file, edit, canvas, run, tools, settings and help options


in the tool bar, you can reach for the most used actions.


the editor is on the left, where you type the TurtleScript commands.


most of the functions of the editor can be found in the file and edit menus.


there are several ways to enter the code in the editor.


Easiest way is to use an example.


Go to the file menu > examples and select an example.


The chosen example will be opened in the editor.


You can select run from the menu bar or the tool bar to run the code.


Another way is to directly type your own code


or copy/paste some code in the editor


(for example, from other kturtle files)



The canvas is on the right, where the turtle makes your drawing.


The turtle draws accordingly to the commands it gets from the editor.

The run option in the tool bar starts the execution of the commands in the editor.


It presents a list of possible execution speeds.


Full speed, slow, slower, slowest and step-by-Step


the abort and the pause options allow you to stop and pause the executions respectively

Switch back to Slide 4
(Lesson Outline)
In this tutorial we will see


moving the turtle


how to draw lines and


changing directions.

KTurtle Window
Using the Tool
When you open KTurtle,


the turtle is in the middle of the canvas by default.


Let us start by getting the turtle to move.


The turtle can do three types of moves:

it can move forwards and backwards


it can turn left and right; and


it can go (or jump) directly to a position on the screen.


Let us go through a simple example.


In your editor, type the following commands:


reset

forward 100

turnleft 120

forward 100

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.


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


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


and the repeat command is followed by the number 3 (because a triangle has 3 sides).


These commands are run 3 times in a loop


and all the 3 sides of the triangle are drawn.

KTurtle Window -Saving and Opening a File
To save a file,


select menu item File > Save As .


I will select the Documents folder,


then the Kturtle folder within it.


I will enter the file name as triangle and click Save.


Notice that the name appears in the top panel


and it is saved as a .turtle file like all KTurtle files.


Now to open a file, go to File > Open.


Select the file to open.

Switch to Slide 5
(Assignment)
Now to the ASSIGNMENT


Here I would like you to draw a square


by using the commands which we have just learnt.


That is , forward, backward, turnleft, turnright and repeat


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.

Switch to Slide 6
(Acknowledgement)
I would like to acknowledge the spoken tutorial project


which is part of the talk to a teacher project.


It is supported by the National Mission on Education through ICT, MHRD government of India.


And you can see more information about this at this website.

Switch to Slide 7
(Thank You)
Thank you this is Sindhu signing off. Enjoy exploring KTurtle.

Contributors and Content Editors

Chandrika, Madhurig