Fractalization level help

my code:

# Check the guide for the description of the problem
# Here are some functions to help draw the curves.

def degreesToRadians(degrees):
    # All vector operations require working in radians rather than degrees.
    return Math.PI / 180 * degrees
    
def koch(start, end):
    # This function will draw a Koch Curve between two Vector positions
    # Start by creating a vector from start to end using Vector.subtract.
    # full = ...
    full = Vector.subtract(start,end)
    
    # Use the magnitude of the vector to check for the stop condition.
    if 
        # Move into position and draw the line, don't forget to toggle flowers properly.
        
        return
    
    # Need to draw 4 shorter Koch curves with sides 1/3 the length.
    # We will calculate the 3 intermediate points, A, B, & C.
    # We just need the point that is one-third of the full Vector from the start Vector.
    third = Vector.multiply(full, 1 / 3)
    A = Vector.add(start, third)
    # This one needs to be rotated 60 degrees from A but the same length.  Use rotate and add to get B.
    
    # This point works out to adding another third to A.
    
    # Now we can draw the 4 curves connecting start, A, B, C, and end.
    
whiteXs = [Vector(6, 6), Vector(74, 6), Vector(74, 61), Vector(6, 61)]


i do not understand what the first if command should be

The whole code whould be like:

# Check the guide for the description of the problem
# Here are some functions to help draw the curves.

def degreesToRadians(degrees):
    # All vector operations require working in radians rather than degrees.
    return Math.PI / 180 * degrees
    
def koch(start, end):
    # This function will draw a Koch Curve between two Vector positions
    # Start by creating a vector from start to end using Vector.subtract.
    # full = ...
    full = Vector.subtract(end, start)
    distance = full._______#what?..Look t the hink down there!
    
    # Use the magnitude of the vector to check for the stop condition.
    if distance < ____#think, think, think! Hint:a very small number.
        # Move into position and draw the line, don't forget to toggle flowers properly.
        hero.toggleFlowers(False)
        hero.move(#where do you move? start or end?)
        hero.toggleFlowers(True)
        hero.move(#where do you move? start or end?)
        return
    
    # Need to draw 4 shorter Koch curves with sides 1/3 the length.
    # We will calculate the 3 intermediate points, A, B, & C.
    # We just need the point that is one-third of the full Vector from the start Vector.
    third = Vector.multiply(full, 1 / 3)
    A = Vector.add(start, third)
    # This one needs to be rotated 60 degrees from A but the same length.  Use rotate and add to get B.
    B = Vector.add(_, Vector.rotate(____, degreesToRadians(__)))
    # This point works out to adding another third to A.
    C = Vector.add(_, _____)
    # Now we can draw the 4 curves connecting start, A, B, C, and end.
    #use "koch"
    #Start ~ A
    #A ~ B
    #B ~ C
    #C ~ End
whiteXs = [Vector(6, 6), Vector(74, 6), Vector(74, 61), Vector(6, 61)]
hero.setFlowerColor("white")
# 0~1
# 1~2
# 2~3
# 3 ~ 0


also click hint to see more

still no work my new code is

# Check the guide for the description of the problem
# Here are some functions to help draw the curves.

def degreesToRadians(degrees):
    # All vector operations require working in radians rather than degrees.
    return Math.PI / 180 * degrees
    
def koch(start, end):
    # This function will draw a Koch Curve between two Vector positions
    # Start by creating a vector from start to end using Vector.subtract.
    # full = ...
    full = Vector.subtract(end, start)
    distance = full.magnitude
    
    # Use the magnitude of the vector to check for the stop condition.
    if distance < 1:#think, think, think! Hint:a very small number.
        # Move into position and draw the line, don't forget to toggle flowers properly.
        hero.toggleFlowers(False)
        hero.move(start)
        hero.toggleFlowers(True)
        hero.move(end)
        return
    
    # Need to draw 4 shorter Koch curves with sides 1/3 the length.
    # We will calculate the 3 intermediate points, A, B, & C.
    # We just need the point that is one-third of the full Vector from the start Vector.
    third = Vector.multiply(full, 1 / 3)
    A = Vector.add(start, third)
    # This one needs to be rotated 60 degrees from A but the same length.  Use rotate and add to get B.
    B = Vector.add(third, Vector.rotate(A, degreesToRadians(60)))
    # This point works out to adding another third to A.
    C = Vector.add(third, A)
    # Now we can draw the 4 curves connecting start, A, B, C, and end.
    #use "koch"
    koch(start,A)
    koch(A,B)
    koch(B,C)
    koch(C,end)
whiteXs = [Vector(6, 6), Vector(74, 6), Vector(74, 61), Vector(6, 61)]
hero.setFlowerColor("white")
koch(whiteXs[0],whiteXs[1])
koch(whiteXs[1],whiteXs[2])
koch(whiteXs[2],whiteXs[3])
koch(whiteXs[3],whiteXs[0])
magnitude

is an function

Click hint to see the number

It is “pass”

Its not this

still no work


# Check the guide for the description of the problem
# Here are some functions to help draw the curves.
def degreesToRadians(degrees):
    # All vector operations require working in radians rather than degrees.
    return Math.PI / 180 * degrees
    
def koch(start, end):
    # This function will draw a Koch Curve between two Vector positions
    # Start by creating a vector from start to end using Vector.subtract.
    # full = ...
    full = Vector.subtract(end, start)
    distance = full.magnitude
    
    # Use the magnitude of the vector to check for the stop condition.
    if distance < 3:
        # Move into position and draw the line, don't forget to toggle flowers properly.
        hero.toggleFlowers(False)
        hero.move(start)
        hero.toggleFlowers(True)
        hero.move(end)
        pass
    
    # Need to draw 4 shorter Koch curves with sides 1/3 the length.
    # We will calculate the 3 intermediate points, A, B, & C.
    # We just need the point that is one-third of the full Vector from the start Vector.
    third = Vector.multiply(full, 3)
    A = Vector.add(start, third)
    # This one needs to be rotated 60 degrees from A but the same length.  Use rotate and add to get B.
    B = Vector.add(third, Vector.rotate(A, degreesToRadians(60)))
    # This point works out to adding another third to A.
    C = Vector.add(third, A)
    # Now we can draw the 4 curves connecting start, A, B, C, and end.
    #use "koch"
    koch(start,A)
    koch(A,B)
    koch(B,C)
    koch(C,end)
whiteXs = [Vector(6, 6), Vector(74, 6), Vector(74, 61), Vector(6, 61)]
hero.setFlowerColor("white")
koch(whiteXs[0],whiteXs[1])
koch(whiteXs[1],whiteXs[2])
koch(whiteXs[2],whiteXs[3])
koch(whiteXs[3],whiteXs[0])

should be this:

distance = full.magnitude()

still not working


# Check the guide for the description of the problem
# Here are some functions to help draw the curves.
def degreesToRadians(degrees):
    # All vector operations require working in radians rather than degrees.
    return Math.PI / 180 * degrees
    
def koch(start, end):
    # This function will draw a Koch Curve between two Vector positions
    # Start by creating a vector from start to end using Vector.subtract.
    # full = ...
    full = Vector.subtract(end, start)
    distance = full.magnitude()
    
    # Use the magnitude of the vector to check for the stop condition.
    if distance < 3:
        # Move into position and draw the line, don't forget to toggle flowers properly.
        hero.toggleFlowers(False)
        hero.move(start)
        hero.toggleFlowers(True)
        hero.move(end)
        pass
    
    # Need to draw 4 shorter Koch curves with sides 1/3 the length.
    # We will calculate the 3 intermediate points, A, B, & C.
    # We just need the point that is one-third of the full Vector from the start Vector.
    third = Vector.multiply(full, 3)
    A = Vector.add(start, third)
    # This one needs to be rotated 60 degrees from A but the same length.  Use rotate and add to get B.
    B = Vector.add(third, Vector.rotate(A, degreesToRadians(60)))
    # This point works out to adding another third to A.
    C = Vector.add(third, A)
    # Now we can draw the 4 curves connecting start, A, B, C, and end.
    #use "koch"
    koch(start,A)
    koch(A,B)
    koch(B,C)
    koch(C,end)
whiteXs = [Vector(6, 6), Vector(74, 6), Vector(74, 61), Vector(6, 61)]
hero.setFlowerColor("white")
koch(whiteXs[0],whiteXs[1])
koch(whiteXs[1],whiteXs[2])
koch(whiteXs[2],whiteXs[3])
koch(whiteXs[3],whiteXs[0])

Remember “move” function will just move a little, you should use moveXY

Sorry , this is right :pray:

still not working


# Check the guide for the description of the problem
# Here are some functions to help draw the curves.
def degreesToRadians(degrees):
    # All vector operations require working in radians rather than degrees.
    return Math.PI / 180 * degrees
    
def koch(start, end):
    # This function will draw a Koch Curve between two Vector positions
    # Start by creating a vector from start to end using Vector.subtract.
    # full = ...
    full = Vector.subtract(end, start)
    distance = full.magnitude()
    
    # Use the magnitude of the vector to check for the stop condition.
    if distance < 3:
        # Move into position and draw the line, don't forget to toggle flowers properly.
        hero.toggleFlowers(False)
        hero.moveXY(start.x,start.y)
        hero.toggleFlowers(True)
        hero.moveXY(end.x,end.y)
        pass
    
    # Need to draw 4 shorter Koch curves with sides 1/3 the length.
    # We will calculate the 3 intermediate points, A, B, & C.
    # We just need the point that is one-third of the full Vector from the start Vector.
    third = Vector.multiply(full, 1/3)
    A = Vector.add(start, third)
    # This one needs to be rotated 60 degrees from A but the same length.  Use rotate and add to get B.
    B = Vector.add(third, Vector.rotate(A, degreesToRadians(60)))
    # This point works out to adding another third to A.
    C = Vector.add(third, A)
    # Now we can draw the 4 curves connecting start, A, B, C, and end.
    #use "koch"
    koch(start,A)
    koch(A,B)
    koch(B,C)
    koch(C,end)
whiteXs = [Vector(6, 6), Vector(74, 6), Vector(74, 61), Vector(6, 61)]
hero.setFlowerColor("white")
koch(whiteXs[0],whiteXs[1])
koch(whiteXs[1],whiteXs[2])
koch(whiteXs[2],whiteXs[3])
koch(whiteXs[3],whiteXs[0])

You ignore what i said

Everything?!?!? (20 chars)

whiteXs = [Vector(6, 6), Vector(74, 6), Vector(74, 62), Vector(6, 62)]
Try copying and pasting this into your code to replace
whiteXs = [Vector(6, 6), Vector(74, 6), Vector(74, 61), Vector(6, 61)]

1 Like

@TheCodingCrusader22 What does the hint say and your current code look like? Also could I have the level link please?
-Wrathion, The Black Prince

Adding to that, please post your hero and equipment.

1 Like

this is not a fighting level it is a flower art level

i am still stuck can someone help me

my curent code

# Check the guide for the description of the problem
# Here are some functions to help draw the curves.
def degreesToRadians(degrees):
    # All vector operations require working in radians rather than degrees.
    return Math.PI / 180 * degrees
    
def koch(start, end):
    # This function will draw a Koch Curve between two Vector positions
    # Start by creating a vector from start to end using Vector.subtract.
    # full = ...
    full = Vector.subtract(end, start)
    distance = full.magnitude()
    
    # Use the magnitude of the vector to check for the stop condition.
    
        # Move into position and draw the line, don't forget to toggle flowers properly.
    if distance < 3:
        hero.toggleFlowers(False)
        hero.moveXY(start.x,start.y)
        hero.toggleFlowers(True)
        hero.moveXY(end.x,end.y)
            
    
    # Need to draw 4 shorter Koch curves with sides 1/3 the length.
    # We will calculate the 3 intermediate points, A, B, & C.
    # We just need the point that is one-third of the full Vector from the start Vector.
    third = Vector.multiply(full, 1/3)
    A = Vector.add(start, third)
    # This one needs to be rotated 60 degrees from A but the same length.  Use rotate and add to get B.
    B = Vector.add(third, Vector.rotate(A, degreesToRadians(60)))
    # This point works out to adding another third to A.
    C = Vector.add(third, A)
    # Now we can draw the 4 curves connecting start, A, B, C, and end.
    #use "koch"
    koch(start,A)
    koch(A,B)
    koch(B,C)
    koch(C,end)
whiteXs = [Vector(6, 6), Vector(74, 6), Vector(74, 61), Vector(6, 61)]
hero.setFlowerColor("white")
koch(whiteXs[0],whiteXs[1])
koch(whiteXs[1],whiteXs[2])
koch(whiteXs[2],whiteXs[3])
koch(whiteXs[3],whiteXs[0])

nvm i did it (20 chars)