How lukmanharahap/827_lc-robot works
This is a console robot-movement simulator. The user chooses to initialize or resume a robot, submits A/L/R commands, and can inspect its position or command history or reset progress. Main coordinates the menu, RobotServiceImpl applies movement and turning rules, and RobotRepositoryImpl persists movement records in src/resource/move.txt. The excerpts show these runtime relationships; other behavior is not assumed.
Main entry points: Main.java Menu and input · RobotServiceImpl.java Command execution · RobotRepositoryImpl.java File repository · Direction.java Direction enum
Components 9
Console interaction
- Menu and input
src/Main.java
Movement logic
- Command execution
src/service/impl/RobotServiceImpl.java - Service contract
src/service/RobotService.java
Robot domain
- Robot state
src/entity/Robot.java - Direction enum
src/utils/enums/Direction.java
Movement persistence
- Repository contract
src/repository/RobotRepository.java - File repository
src/repository/impl/RobotRepositoryImpl.java - Movement log
src/resource/move.txt
Other components
- User
Connections 13
- User → Menu and input: chooses menu
src/Main.java - Menu and input → Command execution: executes command
src/Main.java - Menu and input → Repository contract: reads or resets
src/Main.java - Menu and input → File repository: constructs
src/Main.java - Menu and input → Direction enum: parses direction
src/Main.java - Command execution → Service contract: implements
src/service/impl/RobotServiceImpl.java - Command execution → Repository contract: saves movement
src/service/impl/RobotServiceImpl.java - Command execution → Robot state: updates state
src/service/impl/RobotServiceImpl.java - Command execution → Direction enum: applies turns
src/service/impl/RobotServiceImpl.java - File repository → Repository contract: implements
src/repository/impl/RobotRepositoryImpl.java - File repository → Robot state: loads state
src/repository/impl/RobotRepositoryImpl.java - File repository → Direction enum: parses state
src/repository/impl/RobotRepositoryImpl.java - File repository → Movement log: reads and writes
src/repository/impl/RobotRepositoryImpl.java