# Arup Guha
# 6/10/2022
# Different version of mountains, making some edits off mountain.py

import turtle
import random
import math

def main():

    # Moves turtle to left end of the screen.
    turtle.penup()
    turtle.right(180)
    turtle.forward(300)
    turtle.right(180)
    turtle.pendown()

    # Use to maintain where the turtle is.
    x,y = turtle.pos()

    while x < 300:
        
        sidelength = random.randint(50, 200)
        angle = random.randint(45,89)

        # Turn to go up the mountain and then forward.
        turtle.left(angle)
        turtle.forward(sidelength)
        x,y = turtle.pos()

        ''' I didn't like this so I am commenting it out! 
        turtle.setheading(random.randint(271,315))
        '''

        # Random angle going down.
        turtle.setheading(360-angle)

        # Keep going until within 10 pixels from "ground"
        while y > 10:
            turtle.forward(10)
            x,y = turtle.pos()

        # Fix our direction!
        turtle.setheading(0)
 
main()
