I have an assignment to do with the Koch Snowflake and stack/queue. The problem is that many of us here cannot figure out what is meant by the pseudocode “hint” given in the assignment. Can anybody help maybe?
http://web.cs.mun.ca/~rod/W12/cs2710/assign/a5/assign5.html
Add the initial segments, L.add(seg1) ... L.add(segN)
while not L.isEmpty()
seg = L.remove()
if seg is smaller than the minimum segment size then
draw seg, no new segments are created
else
create four new segments according to
the rules for Koch snowflakes
add these new segments to L
The most confusing part is “if seg is smaller than the minimum segment size”… Not sure what I need to compare to write this.
A segment is a Line segment: from your docu:
So it will be a line drawn on the screen.
You should first look how the Koch Snowflake looks alike: http://en.wikipedia.org/wiki/Koch_snowflake
Now it is easier to understand: “
This is a so called “break condition” which means the line is small enough that it should be drawn on the screen. (Otherwise it would be sub divided, see the Wiki link above).