I have a project to write code in Python that will control a robot's movements in a 10 by 10 grid. First i would like to point out that i am a beginner so it would be better for me if i can get simple lines of code that i can digest.
So, the project asks for:
A 10 by 10 grid, with the robot starting from the uppermost left position which is X(0,0).
Moving from X(0,0) down one tile will increase the value to (1,0) until (9,0) which is the downmost left corner, while moving from X(0,0) to the right will increase each time by (0,1) until (0,9) upper right corner. Moving from position (9,0) to the right will again be up to (9,9).
It will accept commands to move Up, down, left, right (u ,d ,l, r). Each command should be given together with and integer number that denotes the steps to the given direction (for ex. u5, or d2).
The user will give commands continuously until ENTER is pressed which will make the program exit.
After each command, the program must calculate the position of the robot and print out a message with it.
In the case that the user gives a command that cannot be executed or will make the robot go outside the grid, then an error message must appear. It must also give the error message in instances where X or Y => N.
Thanks to anyone who will take the time to help me!
I have not tried anything yet as i am in a loss of what to do and how.