A simple finite state machine implemented to move an imaginary robot through a 5x5 grid space:
--- | --- | --- | --- | --- |
---|---|---|---|---|
--- | --- | --- | --- | --- |
--- | --- | --- | --- | --- |
--- | --- | --- | --- | --- |
:^: | --- | --- | --- | --- |
^^^^^
Start position: (0, 0) pointing north.
N
^
|
W <- :^: -> E (each orientation defines a state of the robot and each state has its own "movement method")
|
v
S
./mvnw spring-boot:run
curl -s --request POST http://localhost:8080/rest/mars/MMRMMRMM
Expected output: (2, 0, S)
curl -s --request POST http://localhost:8080/rest/mars/MML
Expected output: (0, 2, W)
curl -s --request POST http://localhost:8080/rest/mars/AAA
Expected output: 400 Bad Request
curl -s --request POST http://localhost:8080/rest/mars/MMMMMMMMMMMMMMMMMMMMMMMM
Expected output: 400 Bad Request
Hello! I'm Icaro Pablo, I'd be happy if you could provide me any feedback about this repository's code, structure or anything that could make me a better Java programmer. You can contact me following the links in my github page :)
This code is licensed under the MIT License, see the LICENSE file for details.