Does anyone have any nice simple(ish) pattern procedures for MSWLogo that
would have a 'wow' factor on my year 8 kids. We had some network problems on
our last lesson and I need to maintain their interest in this app.
TIA
--
Darren
I like those as well. In fact recursion and parameters are the theme of next
lesson (lesson 2 year 8 - they haven't done logo in year7). I hope to get
them to a point of drawing a square, RT 5, drawing another square and so on
through procedures then altering this code to do polygons using variables
for sides and size. Then similar with Label.
I was after more advanced patterns as an intro 'This is what you can do with
logo" and an extension activity for those who finish (Enter and runs procs
then ammend code for different results).
--
Darren
Yeah, that was the plan :-)
>I doubt you'll get much further than that
> in one lesson. For aesthetic effect, you could try running it as
>
> pd
> repeat 360 [ RT 1 square ]
>
> then
>
> repeat 360 [ RT 1 polygon 5 40 ]
Good thinking .... - I will give this a shot.
{SNIP}
> Mmm, I don't understand "Label" What's that then ?
It sends output to the screen (I hope!!!)
Label "Hello
Label [Like this if you want more than one word]
After the polygons I was going to get them to produce a procedure that will
repeat a spin of there name or something.
> I had some fun with a procedure that draws a line of a certain length ,
> then turns left a bit, calls itself with a line length set to say 80% of
> the parent line length value, then turns back to the right and does the
same
> again to form a symmetrical branching tree. You also need an if statement
> in there to stop it looping once the detail reached a sufficient fine
limit,
> say length 5.
>
> Then make the angle of bifurcation a passed parameter and run it with
> different combinations of angles and percentages.
>
> This should demonstrate how, from a simple procedure just a few lines
long
> you can generate quite complex and very different looking designs.
{SINPPED CODE}
Cheers for all of that. Something for me to play with tonight ;-)
--
Darren
Why would that require recursion? I'd had thought an iterative method would
be much simpler!
Andrew
--
and...@advanced-ict.info Swatting the wasps from the
http://www.advanced-ict.info pure apple of truth
IMO recursion is never necessary. Even when it appears to be, it can be
avoided, and also IMO, should be. Its only value is in providing food
for thought with some elegant definitions such as pling functions or
reversing lists and so on.
--
Ben
I think to say it is 'never necessary' is incorrect. How would you implement
a quick sort algorithm without doing it recursively?
D
Andy is right - there are certain classes of problems (called something like
NP-complete, if I can remember back to my degree days!), such as timetabling
or the 8 Queens Problem - basically anything that involves trying to fit
smaller things into a larger thing - that can only be solved by "recursive
backtracking" algorithms.
In most other cases you can probably get by without it, though, and I'd have
thought it was a rather heavy concept for year 7 and their Logo lessons!
Andrew
I really do object to "tail recursion" in which people are encouraged to
build loops by the lazy method of adding a further procedure call as the
last line of a procedure. Aaaargh, nasty, and promotes bad habits.
--
Ben
>
>"andy roberts" <andy.r...@zetnet.co.uk> wrote in message
>news:5ns94vkdkbe53efhe...@4ax.com...
>> Have you taught them parameter substitution and recursion yet? Those
>> concepts have a high wow factor, well I think so anyway.
>
>I like those as well. In fact recursion and parameters are the theme of next
>lesson (lesson 2 year 8 - they haven't done logo in year7). I hope to get
>them to a point of drawing a square, RT 5, drawing another square and so on
>through procedures then altering this code to do polygons using variables
>for sides and size. Then similar with Label.
>
Drawing a chess board. Draw 8 squares in a row and fill every other
one. Turn around and come back the other way. Turn around again and
repeat the previous steps 3 more times.
Get's them thinking spacially espcially at the end of lines.
Another idea is the star
to star :points
repeat (:points*2) [fd 150 rt 180-(180/:points)]
end
This works for all odd and even integers greatar than or equal to 4
Even numbers give double the points
Odd numbers give exact number of points
Good fun to play with at Christmas.
MTW
www.mathszone.co.uk
www.southbury.enfield.sch.uk
____________________________________________
Actually for plenty of real world problems
using recursion (either direct or mutual)
makes for considerably easier coding.
--
Mark Evans
St. Peter's CofE High School
Phone: +44 1392 204764 X109
Fax: +44 1392 204763