#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
Marvin with a simple menu to start up with.
Marvin doesnt do anything, just presents a menu with some choices.
You should add functinoality to Marvin.
"""

import marvin
import quote

marvin_image = r"""
         _
        [ ]
       (   )
        |>|
     __/===\__
    //| o=o |\\
  <]  | o=o |  [>
      \=====/
     / / | \ \
    <_________>
"""

"""
Its an eternal loop, until q is pressed.
It should check the choice done by the user and call a appropriate
function.
"""

def run():
    """
    Program main function.
    Runs at end to load all functions.
    """

    while True:
        print(chr(27) + "[2J" + chr(27) + "[;H")
        print(marvin_image)
        print("Hi, I'm Marvin. I know it all. What can I do you for?")
        print("1) Present yourself to Marvin.")
        print("2) Celcius to Farenheit.")
        print("3) Wordmultiplier.")
        print("4) Sum and average.")
        print("5) Comparison.")
        print("6) Character addition.")
        print("7) Isogram.")
        print("8) Randomise string.")
        print("9) Anagram.")
        print("10) Akronym.")
        print("11) Mask.")
        print("12) Status.")
        print("A1) String check.")
        print("B1) Grade points.")
        print("B2) String compare.")
        print("q) Quit.")

        choice = input("--> ")

        if choice == "q":
            print("Bye, bye - and welcome back anytime!")
            break
        elif choice == "citat":
            quote.next_quote()
        elif choice == "1":
            marvin.present()
        elif choice == "2":
            marvin.celcius_to_farenheit()
        elif choice == "3":
            marvin.wordmultiplier()
        elif choice == "4":
            marvin.sum_and_average()
        elif choice == "5":
            marvin.comparison()
        elif choice == "6":
            marvin.character_addition()
        elif choice == "7":
            marvin.isogram()
        elif choice == "8":
            marvin.chaosify()
        elif choice == "9":
            marvin.anagram()
        elif choice == "10":
            marvin.akronym()
        elif choice == "11":
            marvin.mask()
        elif choice == "12":
            marvin.status()
        elif choice == "A1":
            marvin.string_check()
        elif choice == "B1":
            marvin.grade_points()
        elif choice == "B2":
            marvin.string_compare()
        else:
            print("That is not a valid choice. You can only choose from the menu.")

        input("\nPress enter to continue...")

if __name__ == "__main__":
    run()
