Artificial Intelligence Robot - Version 1This program has the iRobot guess the animal you are thinking of by asking you questions. If it doesn't know the animal, then it will ask you to name it and then provide a question to distinquish it from another animal that the robot already knows. That animal is then added to the list of animals the program knows. A tree structure based on the attached Node class allows the names and questions to be stored in the tree. The program, when run, initially asks the question, “Is the animal bigger than a human?” and it only knows two animals … a dog (smaller) and a bear (bigger). I have a file version of the program where the contents of the tree are retrieved and rewritten to a text file. Once I get Version 2 working I will post that version. This program was originally written for Java 1.4 (note use of a ConsoleReader class) but will compile and run with Java 1.5. You will want to have students write portions of the code in the driver (Animal1.java) or the Node class. If you update the program to Java 1.5 then you won't need the ConsoleReader class. Posted 5 months, 1 week ago by JimConrey Tagged with: csbots |
|
