Does anyone know how to convert a koch snowflake program from a recursive function to one generalised iterative function for all levels?

Thanks

Does anyone know how to convert a koch snowflake program from a recursive function to one generalised iterative function for all levels?

Thanks

Hi,

with great and amazing difficulty. It would likely be ungodly convoluted. Why do you want to do that? I mean, if you explain the WHOLE problem (such as, I want a list of verticies of the koch snowflake in clockwise order, for example) then you might get a better solution. (Incidentially, you can get the list and still ahev the ease of a recursive algo).

cheers.

John

Thanks for replying

I know it’s a horrible task but it’s something i need to do for a project at university.

What it is, is that I have been given a koch snowflake written in the standard recursive fashion and I have to convert it so that it uses a generalised iterative function.

I’ll send you the code to let you see what I’m working with

Thanks again