"""
CSCI 145 Day 10 - recursion

For each function, decide on the base case and the recursive case first.
Then play with the turtle: uncomment turtle_play() at the bottom.
Bonus: staircase.
Test your functions with the calls at the bottom once you're done.
"""

import turtle as t


def has_vowel(word):
    """
    Return True if word contains a lowercase vowel (a, e, i, o, or u).
    Use recursion, not a loop.

    If word contains a vowel, returns True.
    Otherwise, returns False.

    Params: word (str) -- the word to check
    Returns: bool
    """
    # your code here


def all_even(nums):
    """
    Return True if every number in nums is even.
    Use recursion, not a loop.

    If every number in nums is even, returns True.
    Otherwise, returns False.
    An empty list has no odd numbers, so all_even([]) returns True.

    Params: nums (list of int) -- the numbers to check
    Returns: bool
    """
    # your code here


def is_sorted(nums):
    """
    Return True if the numbers in nums are in order from smallest to largest.
    Use recursion, not a loop.

    If each number is less than or equal to the one after it, returns True.
    Otherwise, returns False.
    A list with fewer than 2 numbers is sorted.

    Params: nums (list of int) -- the numbers to check
    Returns: bool
    """
    # your code here


# ---------- Turtle ----------


def spiral(length, angle):
    """
    Draw a spiral with the turtle: a side of the given length, a left turn
    of angle degrees, then a smaller spiral.

    If length is greater than 10, draws a side and a smaller spiral.
    Otherwise, draws nothing.

    Params:
        length (float) -- the length of the first side, in pixels
        angle (float) -- how far to turn left after each side, in degrees
    Returns: None
    """
    if length > 10:
        t.forward(length)
        t.left(angle)
        spiral(length * 0.9, angle)


def staircase(step_len):
    """
    Bonus: draw a staircase with the turtle. Each step goes up step_len,
    then right step_len, and the next step is 0.8 times as big.
    Use recursion, not a loop.

    If step_len is at least 5, draws a step and the smaller steps after it.
    Otherwise, draws nothing.

    Params: step_len (float) -- the size of the first step, in pixels
    Returns: None
    """
    # your code here


def turtle_play():
    """
    Draw with the turtle. Change the angle, the length, or the color,
    then run the file again. When staircase is ready, call it here too.

    Params: none
    Returns: None
    """
    t.pencolor("blue")
    spiral(100, 60)
    t.done()


print(has_vowel("rhythm"))           # False
print(has_vowel("crypt"))            # False
print(has_vowel("grape"))            # True
print(has_vowel(""))                 # False
print(all_even([2, 8, 4]))           # True
print(all_even([2, 7, 4]))           # False
print(all_even([]))                  # True
print(is_sorted([1, 3, 3, 8]))       # True
print(is_sorted([1, 3, 2, 8]))       # False
print(is_sorted([5]))                # True
# turtle_play()
