SCRIPT FOR SCRATCH POLYGON CREATOR.

Introduction.
The purpose of this script is to illustrate the use of the following:1. Project orientated learning. 2. Learning by discovery. 3. Community of Inquiry (COI). For this example, Scratch has been chosen as the vehicle. It is assumed that the students have been made familiar with the computer and with the basic structure of Scratch. The purpose of the project is to implement a Scratch program which will cause the sprite to draw a polygon of any number of sides. The students should have no, or little, prior knowledge of angles and their relationship to shapes, but should have been encouraged to use their bodies to form some different shapes by joining together in groups to form triangles squares etc. They will work on this project as a group with even the most reticent among them being encouraged to supply their ideas at each stage. The approach should be to take seriously even the most outlandish seeming idea and trying to see if it can be made to work. An advantage of this approach is that the least advanced of the students takes part and gets to understand the process and can go back to make sure that they fully understand the results, while the more advanced students can go out of the group for periods to devise and implement projects of their own to avoid their being frustrated. This approach, starting with using their bodies (they can even improvise songs or rhymes as mnemonics) to act out the project as a group, then programming the sprite, can be implanted in learning about adding, subtracting, multiplying, long division, etc., before formal lessons on the subjects.

Script.

1

‘G’. F: “We are going to design a program which will instruct the sprite to draw different shapes depending on how many sides it should have. don’t know” 2 . and the group of students. It does not replace Euclidean geometry but helps you to understand what you will be taught in the conventional way. blocks” F (facilitator) : “How would you tell the sprite to draw a circle?” G (group) : “…………. ‘F’ which could be a teacher or a more advanced student helping less advanced students. The start block causes the following series of actions to take place when the green flag is selected. The blocks are all colored and are found in the menus shown below with the same color. To begin with we will do some housekeeping to remove traces of the previous session as we go. The entry in the computer can be made by either a group member or the facilitator. We will start with a simple program and work on adding more to it as we progress.This is an imaginary session between a facilitator. In a real life case there would be cases of backtracking and modification as decisions do not work out. and the fixing of the errors. and to position the sprite in a known position. the clear block removes all traces of the previous session. A further valuable lesson to be learned is that a given result can be arrived at in a number of different ways. We will be using ‘Turtle geometry” which differs from the standard “Euclidean geometry” in the important way that it is more natural.. the ‘pen up’ block prevents the sprite leaving a trace when it is moved to the start position set by the next ‘motion. This is part of a process of working by trial and error where more is often learned from the ideas which did not work out. Within the dialog ‘……’ represents discussion ending with a decision. than by a linear path to the conclusion.

take a step and then turn” F: “Should it be a big step or a small step?” G: “A small step” F: “And how about the turn. G: “……. we can either repeat ‘move –turn’ over and over or I will show you a POWERFUL IDEA called recursion – you don’t have to remember the name but it means that you do you the same thing over and over again. F: “Now. This is done by a number of blocks in the ‘CONTROL’ menu” 3 .Walking” F: “What do you do differently when walking in a straight line and walking round a circle?” G: “…… We turn as we walk” F: ”But the poor sprite can take a step in a straight line or turn. should he turn a lot or a little” G: “A little” F: “Right let’s try the sizes already set for the ‘move’ and ‘turn’ and drag them out?. so what shall we tell him to do? Try moving like the sprite”.F : “Why don’t you walk in a circle and tell us what you are doing?” G : “…. but not both at the same time..

So now we need to figure out how he knows when he has finished drawing one circle. F: “We will make the sprite very small so that we can see what he has drawn. F: “But he does it over and over again. What do you think – how do you know when you have walked round a circle once?” 4 . and we click on the green flag and he draws a circle”.F: “We will chose the ‘forever’ block for now because we do not know how many times we want the sprite to move and turn”.

above the program the sprite position is displayed and it includes the direction” F: “Now. The program and method is based on the following F: “Let us look at the case where we let the sprite go until he is facing the same direction as he was when he started.G: “…….or we are looking at the same thing as when we started…… we are facing the same way” We can try stopping at a line. Let us be curious and.. to do so. but has the disadvantage that the end point is not very precise because of the finite size of the sprite. this works.how far he has moved……how far he has turned” F: “The variables below” and give us those values. The variables are set up as shown replaces replaces the number 15 in the ‘turn’ F: “You will notice that. in the scratch display. to get the sprite to stop. For example. which control should we choose to replace the ‘forever’ block?” 5 . What should we be curious about?” G: “…….. introduce the concept of variables which are names which represent numbers so that the number can be displayed and used in different places while being changed in one place.We could draw a line……. The variable the number 10 in the ‘move’ command and the variable command. let us go back to the circle program and change it by adding variables. as shown in appendix 1.

oh yes.’repeat until’” F: “OK” F: “Oh dear. he does not move.G: “……. Why?” G: “…………….move him away from that position……let him move and turn before the repeat block” 6 ... he is pointing in direction 0 when he starts” F: “What can we do about it?” G: “…….

.take note of which variables change and which stay the same” G: “……. but only after the group has a chance to grapple with the problem.the sprite does not get to face in direction ‘0’” From now on. Now try different values of . or putting in ---. you have gone too far or not far enough. F: “Now I am going to introduce you to another powerful idea called ‘successive approximations’ which means getting nearer to solving a problem in a number of steps. What size of step would you start with?” 7 .some numbers work and others do not. Say that you have to take 10 steps and end up in a place which I have chosen but have not pointed out to you. Why? Try single blocks if you get stuck” -. We will illustrate it by trying an experiment with ourselves. I will tell you after you have taken the 10 steps if you are there.F: “Success!! ---Take note of the value of total degrees in particular. F: “Now do the same with the variable stepping. as concepts get more complex. This number is important. the facilitator will have to take a more active part in the discussion.

which we will call ” F: “For the circle we do not specify the number of sides. how much smaller would you make your step?” G: “…………half way between the last two steps” F: “Right.. 2. Can anyone tell us how we know that it has just passed the 0 heading?” G: “…………don’t know” F: “Let me give you a hint. we can go back and increase by 16 ÷ 2 = 8 for the next try. each one is half the next one so that if we make the step bigger by..Yes” 8 that it has just passed the 0 ” as it passes the 0 heading?” . 4. Now there is a useful series of numbers ‘1. If it goes too far it will be following the same path as the first time round.no” F: “So can we say that if the heading is greater than 0 and less than heading?” G: “. 8.. and 16’. Now the sprite works in exact numbers so that we would have been adding a number to the move size each time around. Now what will you do?” G: “……make the step smaller” F: “If you want to get to the right size in a neat way. Let’s think of how we tell that the sprite has gone past the finish point of the circle. How far did it turn at the very beginning?” G: “…. Can you tell me what is special about them?” G: “……. it turned F: “Can it go more than G: “……. but will do that soon..yes” F: “We will need a new variable for this number. Do you all understand that?” G: “…. say 16 each time until we pass then finish line.G: “………small steps so that we do not get there too soon” F: “So you will gradually take bigger steps until I tell you that you have passed the finish line. each one is twice the one before” F: “Right! Or going backwards.

which do we have to set up again every time we start over? 9 . can you tell me what it is?” G: “…. with this we can say.we don’t know” F: “We are trying to draw figures with different numbers of sides. which we can set to 1 as we do so” F: “We need to go back to the ‘control’ menu to choose a new block. otherwise We can put these blocks inside one another to get the sprite to do complicated things” F: “Let us put it in.. ” . We can say ‘if is = F: “Yes. so we set what we call a flag. Does that tell you what the variable to tell the sprite how many sides he should draw is?” G: “. in this case ... what does he have to do. each time he draws the number of sides and finds that he has not got to 0. which is a variable.start over” F: “Here is a list of the variables. For this we need a new variable. then we need something more. The circle is a special case because it has so many sides. for example.yes it is ” F: “We also need another variable to count the sides as the sprite draws them and we shall call this ” F: “Now we need to think about what we are asking the sprite to do. I can go home. It will become clear that it is easy to make sure that the circle is closed once we have found the secrets of the simpler figures. In fact let us go on to the main object of the project. Try to do it yourself if you like with three sides” G: “……. What should it be?” G: “……. A program which does draw a circle by using successive approximations is in appendix 2 in case anyone would like to work on it.. we can use that to set 1’ then subtract the new variable ÷ 2. so that we need the control (else) I need to stay here’. but we need to do something else otherwise.F: “We will find out later that it useful to know that the sprite has passed through the 0 heading. to draw multi-sided figures. ‘if I it is time to go.

. with the additional variables” 10 .F: “sides” F: “steps” F: “add” F: “nearly there” F: “degrees” F: “total steps” F: “drawn sides” F: “total degrees” G: “…No” G: “… No” G: “… No” G: “… No” G: “… Yes” G: “…Yes” G: “… Yes” G: “… Yes” F: “OK.if heading = 0. so how do we begin after this set up block? Remember that we do not know how many times the sprite will have to start over” G: “…. We start as we have done before. else” F: “But how will set the initial position” G: “OK……forever” F: “Right.

if > 0 and < and ……… Else if =1 ” 11 .if =0 else = 0………….no repeat until = ……….F: “What next? Hint – we have to attempt to draw the figure” G: “………last time we repeated until ” F: “And then?” G: “…….

Don’t forget that if things don’t work the first time.F: “OK let’s try that except to make thing easier to see. 12 . set Scratch to the ‘single step’ mode and follow the program step by step until you realize where It goes wrong”. we will move the sprite to a neutral corner both when we stop and when we are ready to start again.

13 .

. This is not the number which you will learn in geometry class.180” F: ”So what is the size of the inside angle?” G: “……. You can add a new variable = 180 to your script and get the inside angle for all the figures” End of script 14 .. and through how many degrees did we find he would then be turning?” G: ”….180 – the outside angle” F: “What is that in numbers?” G: “…180-120 = 60” F: “That is the angle usually referred to for a triangle with 3 equal sides.he would go back on the first line” F: “Right. you will see that the degrees shown for each turn is 120. what do we see and what is the value of degree?” G: “A straight line and 180 degrees” F: “What does the sprite do at the end of the line?” G: “He turns round and goes back to where he started” F: “Now look at a corner of the triangle and see which way the sprite turned from one side to the next – try it for yourself if it helps. and what would happen if the sprite turned through both one after the other?” G: “……. What is the difference? Before we figure this out let’s set the sides to 2.F: “When you choose 3 sides. Do you see that there are two sizes of turns between the two sides?” G: “……yes……one inside the triangle and one outside” F: “Right.

Then motion could be added – get the sprite to draw a stick figure which walks across the screen. 15 .Suggestions for follow up Each student should try to create his own version of this project. They should end up with differences from the example which should emphasize the fact that there are many different ways to solve a problem. but it should be emphasized that this should be by means of hints and not by showing exactly how to get to the next stage. using the same technique of trial and error. They can help one another in this exercise. Further related projects would be to modify the as the figures are drawn to see what happens. It would be a good exercise to investigate the reason why all these figures end up where they began without having a gap. This could get progressively more realistic as the confidence of the students develops.

Appendix 1. 16 .

17 .Appendix 2.

Sign up to vote on this title
UsefulNot useful