This is just some basic command parsing. A couple of state variables position
and position
are initialized to zero, and then each incoming command is parsed and executed against the state variables. We have the result once all commands are done.
I reused the parsing code from part 1, but replaced the command parsing and added another state variable aim
.