Difference between revisions of "KTurtle/C3/Control-Execution/English-timed"
From Script | Spoken-Tutorial
Line 1: | Line 1: | ||
{|border =1 | {|border =1 | ||
− | + | |'''Time''' | |
− | + | |'''Narration''' | |
|- | |- | ||
− | |00 | + | |00:01 |
||Hello Everybody. | ||Hello Everybody. | ||
|- | |- | ||
− | |00 | + | |00:03 |
||Welcome to this tutorial on '''Control Execution''' in '''KTurtle''' | ||Welcome to this tutorial on '''Control Execution''' in '''KTurtle''' | ||
|- | |- | ||
− | ||00 | + | ||00:10 |
||In this tutorial, we will learn | ||In this tutorial, we will learn | ||
|- | |- | ||
− | |00 | + | |00:13 |
|| ''''while'''' loop and | || ''''while'''' loop and | ||
|- | |- | ||
− | |00 | + | |00:15 |
||''''for'''' loop | ||''''for'''' loop | ||
|- | |- | ||
− | || 00 | + | || 00:17 |
||To record this tutorial I am using,Ubuntu Linux OS Version 12.04 KTurtle version 0.8.1 beta. | ||To record this tutorial I am using,Ubuntu Linux OS Version 12.04 KTurtle version 0.8.1 beta. | ||
|- | |- | ||
− | ||00 | + | ||00:32 |
||We assume that you have basic working knowledge of '''Kturtle'''. | ||We assume that you have basic working knowledge of '''Kturtle'''. | ||
|- | |- | ||
− | |00 | + | |00:38 |
||If not, for relevant tutorials, please visit our website. http://spoken-tutorial.org | ||If not, for relevant tutorials, please visit our website. http://spoken-tutorial.org | ||
|- | |- | ||
− | ||00 | + | ||00:45 |
||Let's open a new '''KTurtle''' Application. | ||Let's open a new '''KTurtle''' Application. | ||
|- | |- | ||
− | |00 | + | |00:48 |
||Click on '''Dash home'''. | ||Click on '''Dash home'''. | ||
|- | |- | ||
− | |00 | + | |00:50 |
||In the Search bar, type KTurtle. | ||In the Search bar, type KTurtle. | ||
|- | |- | ||
− | |00 | + | |00:53 |
||Click on the option.KTurtle Application opens. | ||Click on the option.KTurtle Application opens. | ||
|- | |- | ||
− | ||00 | + | ||00:59 |
||Let me first explain about what is control execution. | ||Let me first explain about what is control execution. | ||
|- | |- | ||
− | ||01 | + | ||01:05 |
||Control execution is controlling the flow of a program. | ||Control execution is controlling the flow of a program. | ||
|- | |- | ||
− | |01 | + | |01:10 |
||Different conditions are used to control program execution. | ||Different conditions are used to control program execution. | ||
|- | |- | ||
− | ||01 | + | ||01:16 |
||Loop is a block of code executed repeatedly till a certain condition is satisfied. | ||Loop is a block of code executed repeatedly till a certain condition is satisfied. | ||
|- | |- | ||
− | |01 | + | |01:25 |
||Eg. '''“while”''' loop and '''“for”''' loop | ||Eg. '''“while”''' loop and '''“for”''' loop | ||
|- | |- | ||
− | ||01 | + | ||01:30 |
||Let's begin the tutorial with '''“while”''' loop | ||Let's begin the tutorial with '''“while”''' loop | ||
|- | |- | ||
− | ||01 | + | ||01:34 |
||In the '''“while'''” loop, the code inside the loop repeats till '''boolean''' evaluates to 'false'. | ||In the '''“while'''” loop, the code inside the loop repeats till '''boolean''' evaluates to 'false'. | ||
|- | |- | ||
− | ||01 | + | ||01:42 |
||Let me explain the structure of '''“while”''' loop. | ||Let me explain the structure of '''“while”''' loop. | ||
Line 79: | Line 79: | ||
}''' | }''' | ||
|- | |- | ||
− | ||01 | + | ||01:56 |
||I already have the code in a text editor. | ||I already have the code in a text editor. | ||
|- | |- | ||
− | ||01 | + | ||01:59 |
||Let me copy the program from text editor and paste it into '''KTurtle''' editor | ||Let me copy the program from text editor and paste it into '''KTurtle''' editor | ||
|- | |- | ||
− | |02 | + | |02:07 |
||Please pause the tutorial here and type the program into your '''KTurtle''' editor. | ||Please pause the tutorial here and type the program into your '''KTurtle''' editor. | ||
|- | |- | ||
− | |02 | + | |02:13 |
|Resume the tutorial after typing the program | |Resume the tutorial after typing the program | ||
|- | |- | ||
− | ||02 | + | ||02:18 |
||Let me zoom into the program text it may possibly be a little blurred. | ||Let me zoom into the program text it may possibly be a little blurred. | ||
|- | |- | ||
− | ||02 | + | ||02:25 |
||Let me explain the code. | ||Let me explain the code. | ||
|- | |- | ||
− | ||02 | + | ||02:27 |
||# sign comments a line written after it. | ||# sign comments a line written after it. | ||
|- | |- | ||
− | |02 | + | |02:32 |
||It means, this line will not be executed while running the program. | ||It means, this line will not be executed while running the program. | ||
|- | |- | ||
− | ||02 | + | ||02:38 |
||'''reset''' command sets '''“Turtle'''” to its '''default''' position. | ||'''reset''' command sets '''“Turtle'''” to its '''default''' position. | ||
|- | |- | ||
− | ||02 | + | ||02:43 |
||'''$x=0''' initializes the value of variable x to zero. | ||'''$x=0''' initializes the value of variable x to zero. | ||
|- | |- | ||
− | ||02 | + | ||02:52 |
||Message in a program is given within double quotes after the '''keyword''' '''message " "''' | ||Message in a program is given within double quotes after the '''keyword''' '''message " "''' | ||
'''“message”''' command takes '''“string”''' as input. | '''“message”''' command takes '''“string”''' as input. | ||
|- | |- | ||
− | |03 | + | |03:04 |
||It shows a pop-up dialog box containing text from the string. | ||It shows a pop-up dialog box containing text from the string. | ||
|- | |- | ||
− | ||03 | + | ||03:11 |
||'''while $x<30''' checks the '''“while”''' condition. | ||'''while $x<30''' checks the '''“while”''' condition. | ||
|- | |- | ||
− | ||03 | + | ||03:17 |
||'''$x=$x+3''' increments the value of variable $x by 3 | ||'''$x=$x+3''' increments the value of variable $x by 3 | ||
|- | |- | ||
− | ||03 | + | ||03:27 |
||'''fontsize 15 ''' sets the font size used by '''print''' command. | ||'''fontsize 15 ''' sets the font size used by '''print''' command. | ||
|- | |- | ||
− | |03 | + | |03:35 |
||Fontsize takes number as input, set in pixels. | ||Fontsize takes number as input, set in pixels. | ||
|- | |- | ||
− | ||03 | + | ||03:42 |
||'''forward 20''' commands '''“Turtle”''' to move 20 steps forward on the canvas. | ||'''forward 20''' commands '''“Turtle”''' to move 20 steps forward on the canvas. | ||
|- | |- | ||
− | ||03 | + | ||03:52 |
||'''print $x''' displays the value of variable x on the canvas. | ||'''print $x''' displays the value of variable x on the canvas. | ||
|- | |- | ||
− | ||04 | + | ||04:01 |
||Let me click on the '''“Run”''' button to run the program. | ||Let me click on the '''“Run”''' button to run the program. | ||
|- | |- | ||
− | |04 | + | |04:05 |
||A message dialog box pops up.Let me click OK. | ||A message dialog box pops up.Let me click OK. | ||
|- | |- | ||
− | ||04 | + | ||04:11 |
||Multiples of 3 from 3 to 30 are displayed on the canvas. | ||Multiples of 3 from 3 to 30 are displayed on the canvas. | ||
|- | |- | ||
− | |04 | + | |04:17 |
||'''“Turtle”''' moves 20 steps forward on the canvas. | ||'''“Turtle”''' moves 20 steps forward on the canvas. | ||
|- | |- | ||
− | ||04 | + | ||04:22 |
||Let's next work with '''“for”''' loop | ||Let's next work with '''“for”''' loop | ||
|- | |- | ||
− | ||04 | + | ||04:26 |
||“for” loop is a counting loop. | ||“for” loop is a counting loop. | ||
|- | |- | ||
− | |04 | + | |04:29 |
||Every time the code inside '''“for”''' loop is executed, | ||Every time the code inside '''“for”''' loop is executed, | ||
|- | |- | ||
− | |04 | + | |04:34 |
||variable value is incremented, till it reaches the end value. | ||variable value is incremented, till it reaches the end value. | ||
|- | |- | ||
− | ||04 | + | ||04:41 |
||Let me explain the structure of '''“for”''' loop. | ||Let me explain the structure of '''“for”''' loop. | ||
|- | |- | ||
− | |04 | + | |04:46 |
||'''for variable = start number to end number { Statement}''' | ||'''for variable = start number to end number { Statement}''' | ||
|- | |- | ||
− | ||04 | + | ||04:55 |
||Let me clear the current program. | ||Let me clear the current program. | ||
|- | |- | ||
− | |04 | + | |04:59 |
||Let me type'''clear'''command and run to clean the canvas. | ||Let me type'''clear'''command and run to clean the canvas. | ||
|- | |- | ||
− | ||05 | + | ||05:05 |
||Let me copy the program from text editor and paste it into KTurtle editor | ||Let me copy the program from text editor and paste it into KTurtle editor | ||
|- | |- | ||
− | |05 | + | |05:14 |
||Please pause the tutorial here and type the program into your KTurtle editor. | ||Please pause the tutorial here and type the program into your KTurtle editor. | ||
|- | |- | ||
− | |05 | + | |05:20 |
|| Resume the tutorial after typing the program. | || Resume the tutorial after typing the program. | ||
|- | |- | ||
− | ||05 | + | ||05:25 |
||Let me zoom into the program text it may possibly be a little blurred. | ||Let me zoom into the program text it may possibly be a little blurred. | ||
|- | |- | ||
− | ||05 | + | ||05:32 |
||Let me explain the program. | ||Let me explain the program. | ||
|- | |- | ||
− | ||05 | + | ||05:34 |
||# sign comments a line written after it. | ||# sign comments a line written after it. | ||
|- | |- | ||
− | ||05 | + | ||05:39 |
||'''reset''' command sets '''“Turtle”''' to its '''default''' position. | ||'''reset''' command sets '''“Turtle”''' to its '''default''' position. | ||
|- | |- | ||
− | ||05 | + | ||05:44 |
||'''$r=0''' initializes the value of variable r to zero. | ||'''$r=0''' initializes the value of variable r to zero. | ||
|- | |- | ||
− | ||05 | + | ||05:52 |
||'''for $x= 1 to 15''' checks '''“for”''' condition from 1 to 15. | ||'''for $x= 1 to 15''' checks '''“for”''' condition from 1 to 15. | ||
|- | |- | ||
− | ||06 | + | ||06:01 |
||'''$r=$x*($x+1)/2''' calculates the value of variable r. | ||'''$r=$x*($x+1)/2''' calculates the value of variable r. | ||
|- | |- | ||
− | ||06 | + | ||06:12 |
||'''fontsize 18''' sets the font size used by '''print''' command. | ||'''fontsize 18''' sets the font size used by '''print''' command. | ||
|- | |- | ||
− | ||06 | + | ||06:19 |
||'''print $r''' displays the value of variable'' r '' on the canvas | ||'''print $r''' displays the value of variable'' r '' on the canvas | ||
|- | |- | ||
− | ||06 | + | ||06:26 |
||'''forward 15''' commands '''Turtle'''to moves 15 steps forward on the canvas. | ||'''forward 15''' commands '''Turtle'''to moves 15 steps forward on the canvas. | ||
|- | |- | ||
− | ||06 | + | ||06:34 |
||'''go 10,250''' commands '''Turtle''' to go 10 pixels from left of canvas and 250 pixels from top of canvas. | ||'''go 10,250''' commands '''Turtle''' to go 10 pixels from left of canvas and 250 pixels from top of canvas. | ||
|- | |- | ||
− | ||06 | + | ||06:48 |
||'''“Turtle”''' displays all print commands without any time gap. | ||'''“Turtle”''' displays all print commands without any time gap. | ||
|- | |- | ||
− | |06 | + | |06:54 |
||“Wait 2” command makes Turtle to '''“wait”''' for 2 seconds before executing next command. | ||“Wait 2” command makes Turtle to '''“wait”''' for 2 seconds before executing next command. | ||
|- | |- | ||
− | ||07 | + | ||07:04 |
||'''“print”''' command displays the “string” within double quotes and also displays variable $r. | ||'''“print”''' command displays the “string” within double quotes and also displays variable $r. | ||
|- | |- | ||
− | ||07 | + | ||07:13 |
||Let me click on the '''“ Run”''' button to run the program. | ||Let me click on the '''“ Run”''' button to run the program. | ||
|- | |- | ||
− | |07 | + | |07:17 |
||A series of sum of first 15 natural numbers and sum of first 15 natural numbers is displayed on the canvas. | ||A series of sum of first 15 natural numbers and sum of first 15 natural numbers is displayed on the canvas. | ||
|- | |- | ||
− | |07 | + | |07:27 |
||'''Turtle''' moves 15 steps forward on the canvas. | ||'''Turtle''' moves 15 steps forward on the canvas. | ||
|- | |- | ||
− | ||07 | + | ||07:32 |
||With this we come to the end of this tutorial. | ||With this we come to the end of this tutorial. | ||
|- | |- | ||
− | ||07 | + | ||07:37 |
||Let us summarize. | ||Let us summarize. | ||
|- | |- | ||
− | |07 | + | |07:40 |
||In this tutorial we have learned to use, | ||In this tutorial we have learned to use, | ||
|- | |- | ||
− | |07 | + | |07:44 |
|| '''“while”''' loop and'' “for” ''' loop | || '''“while”''' loop and'' “for” ''' loop | ||
|- | |- | ||
− | ||07 | + | ||07:47 |
||As an assignment I would like you to write programs to evaluate | ||As an assignment I would like you to write programs to evaluate | ||
|- | |- | ||
− | |07 | + | |07:54 |
||Multiples of 2 using “while” loop | ||Multiples of 2 using “while” loop | ||
|- | |- | ||
− | |07 | + | |07:58 |
||Multiplication table of a number using “for” loop | ||Multiplication table of a number using “for” loop | ||
|- | |- | ||
− | ||08 | + | ||08:03 |
||Watch the video available at this URLhttp://spoken-tutorial.org/What is a Spoken Tutorial | ||Watch the video available at this URLhttp://spoken-tutorial.org/What is a Spoken Tutorial | ||
|- | |- | ||
− | |08 | + | |08:08 |
||It summarises the Spoken Tutorial project | ||It summarises the Spoken Tutorial project | ||
|- | |- | ||
− | |08 | + | |08:12 |
||If you do not have good bandwidth, you can download and watch it | ||If you do not have good bandwidth, you can download and watch it | ||
|- | |- | ||
− | |08 | + | |08:17 |
||The Spoken Tutorial Project Team : | ||The Spoken Tutorial Project Team : | ||
|- | |- | ||
− | |08 | + | |08:20 |
||Conducts workshops using spoken tutorials | ||Conducts workshops using spoken tutorials | ||
|- | |- | ||
− | |08 | + | |08:23 |
||Gives certificates to those who pass an online test | ||Gives certificates to those who pass an online test | ||
|- | |- | ||
− | |08 | + | |08:27 |
||For more details, please write to contact@spoken-tutorial.org | ||For more details, please write to contact@spoken-tutorial.org | ||
|- | |- | ||
− | ||08 | + | ||08:36 |
||Spoken Tutorial Project is a part of the Talk to a Teacher project | ||Spoken Tutorial Project is a part of the Talk to a Teacher project | ||
|- | |- | ||
− | |08 | + | |08:41 |
||It is supported by the National Mission on Education through ICT, MHRD, Government of India | ||It is supported by the National Mission on Education through ICT, MHRD, Government of India | ||
|- | |- | ||
− | |08 | + | |08:48 |
||More information on this Mission is available at this link http://spoken-tutorial.org/NMEICT-Intro ] | ||More information on this Mission is available at this link http://spoken-tutorial.org/NMEICT-Intro ] | ||
|- | |- | ||
− | |08 | + | |08:54 |
||This is Madhuri Ganpathi from IIT Bombay signing off | ||This is Madhuri Ganpathi from IIT Bombay signing off | ||
Thank you for joining. | Thank you for joining. | ||
|- | |- |
Revision as of 14:23, 9 July 2014
Time | Narration |
00:01 | Hello Everybody. |
00:03 | Welcome to this tutorial on Control Execution in KTurtle |
00:10 | In this tutorial, we will learn |
00:13 | 'while' loop and |
00:15 | 'for' loop |
00:17 | To record this tutorial I am using,Ubuntu Linux OS Version 12.04 KTurtle version 0.8.1 beta. |
00:32 | We assume that you have basic working knowledge of Kturtle. |
00:38 | If not, for relevant tutorials, please visit our website. http://spoken-tutorial.org |
00:45 | Let's open a new KTurtle Application. |
00:48 | Click on Dash home. |
00:50 | In the Search bar, type KTurtle. |
00:53 | Click on the option.KTurtle Application opens. |
00:59 | Let me first explain about what is control execution. |
01:05 | Control execution is controlling the flow of a program. |
01:10 | Different conditions are used to control program execution. |
01:16 | Loop is a block of code executed repeatedly till a certain condition is satisfied. |
01:25 | Eg. “while” loop and “for” loop |
01:30 | Let's begin the tutorial with “while” loop |
01:34 | In the “while” loop, the code inside the loop repeats till boolean evaluates to 'false'. |
01:42 | Let me explain the structure of “while” loop.
while loop condition { do something with loop increment variable } |
01:56 | I already have the code in a text editor. |
01:59 | Let me copy the program from text editor and paste it into KTurtle editor |
02:07 | Please pause the tutorial here and type the program into your KTurtle editor. |
02:13 | Resume the tutorial after typing the program |
02:18 | Let me zoom into the program text it may possibly be a little blurred. |
02:25 | Let me explain the code. |
02:27 | # sign comments a line written after it. |
02:32 | It means, this line will not be executed while running the program. |
02:38 | reset command sets “Turtle” to its default position. |
02:43 | $x=0 initializes the value of variable x to zero. |
02:52 | Message in a program is given within double quotes after the keyword message " "
“message” command takes “string” as input. |
03:04 | It shows a pop-up dialog box containing text from the string. |
03:11 | while $x<30 checks the “while” condition. |
03:17 | $x=$x+3 increments the value of variable $x by 3 |
03:27 | fontsize 15 sets the font size used by print command. |
03:35 | Fontsize takes number as input, set in pixels. |
03:42 | forward 20 commands “Turtle” to move 20 steps forward on the canvas. |
03:52 | print $x displays the value of variable x on the canvas. |
04:01 | Let me click on the “Run” button to run the program. |
04:05 | A message dialog box pops up.Let me click OK. |
04:11 | Multiples of 3 from 3 to 30 are displayed on the canvas. |
04:17 | “Turtle” moves 20 steps forward on the canvas. |
04:22 | Let's next work with “for” loop |
04:26 | “for” loop is a counting loop. |
04:29 | Every time the code inside “for” loop is executed, |
04:34 | variable value is incremented, till it reaches the end value. |
04:41 | Let me explain the structure of “for” loop. |
04:46 | for variable = start number to end number { Statement} |
04:55 | Let me clear the current program. |
04:59 | Let me typeclearcommand and run to clean the canvas. |
05:05 | Let me copy the program from text editor and paste it into KTurtle editor |
05:14 | Please pause the tutorial here and type the program into your KTurtle editor. |
05:20 | Resume the tutorial after typing the program. |
05:25 | Let me zoom into the program text it may possibly be a little blurred. |
05:32 | Let me explain the program. |
05:34 | # sign comments a line written after it. |
05:39 | reset command sets “Turtle” to its default position. |
05:44 | $r=0 initializes the value of variable r to zero. |
05:52 | for $x= 1 to 15 checks “for” condition from 1 to 15. |
06:01 | $r=$x*($x+1)/2 calculates the value of variable r. |
06:12 | fontsize 18 sets the font size used by print command. |
06:19 | print $r displays the value of variable r on the canvas |
06:26 | forward 15 commands Turtleto moves 15 steps forward on the canvas. |
06:34 | go 10,250 commands Turtle to go 10 pixels from left of canvas and 250 pixels from top of canvas. |
06:48 | “Turtle” displays all print commands without any time gap. |
06:54 | “Wait 2” command makes Turtle to “wait” for 2 seconds before executing next command. |
07:04 | “print” command displays the “string” within double quotes and also displays variable $r. |
07:13 | Let me click on the “ Run” button to run the program. |
07:17 | A series of sum of first 15 natural numbers and sum of first 15 natural numbers is displayed on the canvas. |
07:27 | Turtle moves 15 steps forward on the canvas. |
07:32 | With this we come to the end of this tutorial. |
07:37 | Let us summarize. |
07:40 | In this tutorial we have learned to use, |
07:44 | “while”' loop and “for” loop |
07:47 | As an assignment I would like you to write programs to evaluate |
07:54 | Multiples of 2 using “while” loop |
07:58 | Multiplication table of a number using “for” loop |
08:03 | Watch the video available at this URLhttp://spoken-tutorial.org/What is a Spoken Tutorial |
08:08 | It summarises the Spoken Tutorial project |
08:12 | If you do not have good bandwidth, you can download and watch it |
08:17 | The Spoken Tutorial Project Team : |
08:20 | Conducts workshops using spoken tutorials |
08:23 | Gives certificates to those who pass an online test |
08:27 | For more details, please write to contact@spoken-tutorial.org |
08:36 | Spoken Tutorial Project is a part of the Talk to a Teacher project |
08:41 | It is supported by the National Mission on Education through ICT, MHRD, Government of India |
08:48 | More information on this Mission is available at this link http://spoken-tutorial.org/NMEICT-Intro ] |
08:54 | This is Madhuri Ganpathi from IIT Bombay signing off
Thank you for joining. |