Je veux faire un chat en Java mais je ne sais pas par où commencer? J'ai essayé le code suivant mais je n'ai pas exactement ce dont j'ai besoin. dans ce programme, j'ai dû écrire toutes les possibilités de questions. si quelqu'un a une solution s'il vous plaît aidez-moi.comment faire un bot de chat virtuel en java?
import java.io.*;
public class Chatbot
{
public static void main(String[]args) throws IOException
{
String hel = new String("Hello");
String hel1 = new String("HELLO");
String hel2 = new String("hello");
String hel3 = new String("Hii");
String hel4 = new String("Hiii");
String hel5 = new String("hii");
String hel6 = new String("hiii");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("What is Your Name?");
String name = br.readLine();
System.out.println("Hello "+name+"..");
String hellorep = br.readLine();
if(hellorep .equals(hel))
{
System.out.println("Hello there...");
}
else if(hellorep .equals(hel1))
{
System.out.println("Hello there...");
}
else if(hellorep .equals(hel2))
{
System.out.println("Hello there...");
}
else if(hellorep .equals(hel3))
{
System.out.println("Hii");
}
else if(hellorep .equals(hel4))
{
System.out.println("Hiii");
}
else if(hellorep .equals(hel5))
{
System.out.println("Hii");
}
else if(hellorep .equals(hel6))
{
System.out.println("Hiii");
}
else
{
System.out.println("Please type Again I Didn't get you..");
}
}
}
et c'est une façon simple de le faire sans le regard de code comme de la merde – Hydrox