String responses[] = {
    "I'm sure you're part of the conspiracy.",
    "Why do you want to know that?",
    "I'm being watched.",
    "They are out to get me.",
    "Do you think I'm paranoid?",
    "I know what you're up to.",
    "Why are you so interested in me?",
    "I'm not crazy, you are!",
    "Who sent you?",
    "I don't trust you."
};

void setup() {
    Serial.begin(9600);
    Serial.println("Parry: Hello. How can I help you today?");
}

void loop() {
    if (Serial.available() > 0) {
        String userInput = Serial.readStringUntil('\n');
        userInput.trim();
        String response = getResponse(userInput);
        Serial.println("Parry: " + response);
    }
}

String getResponse(String userInput) {
    userInput.toLowerCase();
    if (userInput.indexOf("who") >= 0) {
        return randomChoice("Who do you think?", "You know who!", "Who wants to know?");
    } else if (userInput.indexOf("why") >= 0) {
        return randomChoice("Why do you care?", "That's none of your business.", "Why do you want to know?");
    } else if (userInput.indexOf("what") >= 0) {
        return randomChoice("What do you mean?", "What are you talking about?", "What do you want from me?");
    } else {
        return randomChoice(
            "I'm sure you're part of the conspiracy.",
            "Why do you want to know that?",
            "I'm being watched.",
            "They are out to get me.",
            "Do you think I'm paranoid?",
            "I know what you're up to.",
            "Why are you so interested in me?",
            "I'm not crazy, you are!",
            "Who sent you?",
            "I don't trust you."
        );
    }
}

String randomChoice(String response1, String response2, String response3) {
    int choice = random(0, 3);
    if (choice == 0) return response1;
    if (choice == 1) return response2;
    return response3;
}

String randomChoice(String response1, String response2, String response3, String response4, String response5, String response6, String response7, String response8, String response9, String response10) {
    int choice = random(0, 10);
    if (choice == 0) return response1;
    if (choice == 1) return response2;
    if (choice == 2) return response3;
    if (choice == 3) return response4;
    if (choice == 4) return response5;
    if (choice == 5) return response6;
    if (choice == 6) return response7;
    if (choice == 7) return response8;
    if (choice == 8) return response9;
    return response10;
}