""" 
 turtle_recursive_curve.py
"""

import turtle

scale = 0.95   # next line segment is shorter by this factor
turn = 5     # next line segment turns by this factor
min_length= 1      # shortest line length
start_length = 20

def init_turtle():
    turtle.width(5)           # in pixels
    turtle.color('#00ccff')   # CSS (r,g,b) hex color
    turtle.hideturtle()       # don't show the turtle itself

def curve(length):
    """ Recursively draw a curve. """
    # Draw a line with given length, then rest of curve, then reset """
    turtle.forward(length)          # draw 
    turtle.right(turn)         # turn
    if length > min_length:                # recursively draw the rest
        curve(length * scale)
    turtle.right(-turn)          # undo - return to starting spot
    turtle.forward(-length)    

def main():
    init_turtle()
    curve(start_length)
    input("Hit return to quit.")

main()