# Author:  James Tam
# Version: May 24, 2022 (starting program)
# Learning: how functions communicated.
# *Information local to one function is needed by another function
#  e.g. prompt user for color in askColor but this function needs
#  information from another function (car)
# Note: this program is kept as simple as possible to illustrate the above
# principles consequently rather implementing a real function that performs
# one clear task but has one piece of information of information stored as
# a local and another passed as a parameter the functions were implemented
# as toy functions (Don't do anything useful) to keep them simple so they
# appear to violate the design rule (functions implement just one task).


def askCarShowColor():
    favoriteCar = input("Favorite car: ")

def askColorShowCar():
    favoriteCar = input("Favorite color: ") 

def start():
    stillPlaying = True
    favoriteColor = "Blue"
    favoriteCar = "Talon"
    while (stillPlaying == True):
        print("Playing")
        if (stillPlaying == True):
            askCarShowColor()
        if (stillPlaying == True):
            askColorShowCar()
        input("Hit enter to run another turn")
    if ((favoriteCar in ("q","q") or (favoriteColor in ("q","Q")))):
            stillPlaying = False        


start()
