package CHAPTER12;

class TypingEffect implements Runnable {
    private String message;

    public TypingEffect(String message) {
        this.message = message;
    }

    public void run() {
        for (char ch : message.toCharArray()) {
            System.out.print(ch);
            try {
                Thread.sleep(100); // 타자 속도
            } catch (InterruptedException e) {
                break;
            }
        }
        System.out.println();
    }
}

public class ChatbotSimulator {
    public static void main(String[] args) {
        Thread chatbot = new Thread(new TypingEffect("안녕하세요. 무엇을 도와드릴까요?"));
        chatbot.start();
    }
}
