This is a greenfield Java project for the Mochi chatbot. Given below are instructions on how to use it.
Prerequisites: JDK 25, update Intellij to the most recent version.
- Open Intellij (if you are not in the welcome screen, click
File>Close Projectto close the existing project first) - Open the project into Intellij as follows:
- Click
Open. - Select the project directory, and click
OK. - If there are any further prompts, accept the defaults.
- Click
- Configure the project to use JDK 25 (not other versions) as explained in here.
In the same dialog, set the Project language level field to theSDK defaultoption. - After that, locate the
src/main/java/mochi/Mochi.javafile, right-click it, and chooseRun Mochi.main()(if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output:____________________________________________________________ Hello! I'm Mochi. What can I do for you? ____________________________________________________________ todo borrow book ____________________________________________________________ Got it. I've added this task: [T][ ] borrow book Now you have 1 task in the list. ____________________________________________________________ deadline return book /by 2026-08-30 ____________________________________________________________ Got it. I've added this task: [D][ ] return book (by: Aug 30 2026) Now you have 2 tasks in the list. ____________________________________________________________ event project meeting /from Mon 2pm /to 4pm ____________________________________________________________ Got it. I've added this task: [E][ ] project meeting (from: Mon 2pm to: 4pm) Now you have 3 tasks in the list. ____________________________________________________________ mark 2 ____________________________________________________________ Nice! I've marked this task as done: [D][X] return book (by: Aug 30 2026) ____________________________________________________________ unmark 2 ____________________________________________________________ OK, I've marked this task as not done yet: [D][ ] return book (by: Aug 30 2026) ____________________________________________________________ list ____________________________________________________________ Here are the tasks in your list: 1.[T][ ] borrow book 2.[D][ ] return book (by: Aug 30 2026) 3.[E][ ] project meeting (from: Mon 2pm to: 4pm) ____________________________________________________________ delete 3 ____________________________________________________________ Noted. I've removed this task: [E][ ] project meeting (from: Mon 2pm to: 4pm) Now you have 2 tasks in the list. ____________________________________________________________ todo ____________________________________________________________ Oops! A todo needs a description. ____________________________________________________________ blah ____________________________________________________________ Oops! I don't know that command yet. Try todo, deadline, event, list, mark, unmark, delete, or bye. ____________________________________________________________ bye ____________________________________________________________ Bye. Hope to see you again soon! ____________________________________________________________
Mochi saves task data automatically in data/mochi.txt and reloads it the next time the application starts.
Use ./gradlew build to build the project and ./gradlew run to run Mochi.
Use ./gradlew test to run the JUnit test suite.
The build creates the executable build/libs/mochi.jar, which can be run using java -jar mochi.jar.
Warning: Keep the src\main\java folder as the root folder for Java files (i.e., don't rename those folders or move Java files to another folder outside of this folder path), as this is the default location some tools (e.g., Gradle) expect to find Java files.
ChatGPT in Codex mode was used to review and refine the Level-0 through Level-8 implementations and documentation, including the A-Classes, A-Inheritance, A-Exceptions, A-Collections, A-Enums, A-MoreOOP, A-Packages, A-Gradle, A-JUnit, A-Jar, A-JavaDoc, A-CodingStandard, and Level-9 enhancements.