import turtle

def goto_bounded(t, x, y, x_max, y_max):
    """ Go to position (x, y), unless it falls outside the box
    from (-max_x, -max_y) to (max_x, max_y), in which case
    the turtle should not move.
    Returns True if the turtle ended at (x,y), or False
    if it stayed where it was. """
    
    if x > x_max or y > y_max or x < -x_max or y < -y_max:
        return False
 
    t.goto(x, y)
    return True

def box(t, height, width):
    """ Use turtle t to draw a box with the given height and width.
    Height and width are defined assuming "up" is to the turtle's left.
    The box is drawn counter-clockwise, and the turtle ends in the same
    pose as it started. """
    for i in range(2):
        t.forward(width)
        t.left(90)
        t.forward(height)
        t.left(90)
    
    
    
def star(t, side_length):
    """ Draw a star (???) """
    for i in range(8):
        t.forward(side_length)
        t.left(135)
    
if __name__ == "__main__":
    t = turtle.Turtle()
#     print(goto_bounded(t, 50, 50, 100, 100))
#     print(goto_bounded(t, -150, -150, 100, 100))
#     print(t.position())
#     
#     box(t, 100, 30)
    star(t, 50)
    turtle.done()
    