Example #1
0
        static void Main(string[] args)
        {
            // Constructors for instances of each base
            Chat    chat    = new Chat();
            English english = new English();

            Console.WriteLine(" \t\t\t\t\tAthena Cyberbot - Orbis Labs ");

            while (me != $"Goodbye {name}")
            {
                // Input
                you = chat.Hear(you);     // Propt "you" to speak

                // Process
                me = chat.Think(you, temp, me);     // Think about what "you" said

                // Respond
                Speak(me);     // Say after Thinking
            }
        }
Example #2
0
        // Think about what what was said
        public override string Think(string you, string temp, string me) // Override for specialization
        {
            // Think Testing
            //if (you == "Hello" || you == "Goodbye")
            //{
            //    me = you + ", " + name; // Output
            //}
            //else if (you != "Hello" || you != "Goodbye")
            //{
            //    me = null;
            //    // Defualt
            //    if (me == null)
            //    {
            //        me = "I don't know what to say.";
            //    }
            //}

// Think -----------------------------------------------------------------------------------------------
            switch (you) // Based on what "you" say
            {
            case "Start":
                me = "Welcome! To begin, say \"Hello\". For help say \"Help\"";
                break;

// Hello -----------------------------------------------------------------------------------------------
            case "Hello":                                                      // "you" say
                Console.WriteLine("\n---> Hello, what is your first name?\n"); // "me" say
                Console.Write("\n~~~> ");                                      // Promt "you"
                name = Console.ReadLine();                                     // your response
                me   = $"Nice to meet you {name}";                             // "me" say
                break;

            // Help
            case "Help":                                  // "you" say
                Console.WriteLine("\n---> You can say:"); // "me" say
                me = "Hello, What is your name?, What is the weather like?, You too, and Goodbye.";
                break;

            // Thank you -------------------------------------------------------------------------------------------
            case "Thank you":                    // "you" say
                me = $"You are welcome {name}."; // "me" say
                break;

// My Name ---------------------------------------------------------------------------------------------
            case "What is your name?":     // "you" say
                me = "My name is Athena";  // "me" say
                break;

// Goodbye ---------------------------------------------------------------------------------------------
            case "Goodbye":            // "you" say
                me = you + " " + name; // "me" say
                break;

// Weather ---------------------------------------------------------------------------------------------
            case "What is the weather like?":                                            // "you" say
                English.Speak("What is your zipcode?");                                  // "me" say
                Console.Write("\n~~~> ");                                                // Promt "you"
                zipcode = Console.ReadLine();                                            // your response
                me      = "Sorry, I am having difficulties connecting to the Internet."; // "me" say
                // Action
                Weather(zipcode);                                                        // Get current weather based on zipcode
                break;

// You Too ---------------------------------------------------------------------------------------------
            case "You too":
                me = "How is your day going?";
                break;

// Default ---------------------------------------------------------------------------------------------
            default:
                me = "Can you repeat that?";     // "me" say
                break;
            }
            // Return statement
            return(me);
        }