K.
RAMAKRISHNAN COLLEGE OF ENGINEERING
(AUTONOMOUS)
ROBOT MOVEMENT
Presented by,
Name : [Link]
Register No. : 8115U23CS077
Roll. No. : CSB2315
Year & Section : I /CSE B
Domain : Variables and
Strings
Date of Review : 20-06-2024
PRESENTATION OVERVIEW
Objective
System Architecture(Flow Diagram)
Modules used
Modules description
CodeTantra Implementation Screenshot
Execution of the code
Conclusion
OBJECTIVE OF THE PROJECT
The program simulates movement on a grid where the object starts at position (0, 0).
.
It then processes each instruction in the provided sequence
Up (U): Moves the object one unit north.
Down (D): Moves the object one unit south.
Left (L): Moves the object one unit west.
Right (R): Moves the object one unit east.
After processing all instructions, the program returns the final coordinates (x, y) of the object's
position.
PROPOSED SYSTEM
ARCHITECTURE/FLOW DIAGRAM
.
MODULES USED
Module 1:UP MOVEMENT
Module 2: DOWN MOVEMENT
Module 3:LEFT MOVEMENT
Module 4: RIGHT MOVEMENT
MODULES USED
Module 1:UP MOVEMENT
• In the code you provided, the "up" movement is represented by the
letter "U" in the instruction string. When the program encounters a "U" in the
string, it translates this to moving the hypothetical object one unit north.
• For "up", the dy value would be 1 (positive y represents north).
MODULES USED
Module 2:DOWN MOVEMENT
• In the code you provided, the “Down" movement is represented by the
letter “D" in the instruction string. When the program encounters a “D" in the
string, it translates this to moving the hypothetical object one unit South
• For “Down", the dy value would be -1 (negative y represents south).
MODULES USED
Module 3: LEFT MOVEMENT
• In the code you provided, the “Left" movement is represented by the
letter “L" in the instruction string. When the program encounters a “L" in the
string, it translates this to moving the hypothetical object one unit West
• For “Left", the dx value would be -1 (negative x represents West).
MODULES USED
Module 4 : RIGHT MOVEMENT
• In the code you provided, the “Right movement is represented by the letter “R"
in the instruction string. When the program encounters a “R" in the string, it translates
this to moving the hypothetical object one unit East
• For “Right", the dx value would be 1 (positive x represents East).
CODETANTRA IMPLEMENTATION SCREENSHOT
Output
EXECUTION IN AN ONLINE COMPILER
17/12/2024 11
CONCLUSION
The provided code defines a function that calculates the final position of an imaginary object based on a
sequence of movement instructions. It simulates movement on a grid-like system where the object starts at
a specific location (0, 0) and can move up (U), down (D), left (L), or right (R) based on the instructions
provided.
This code snippet can be a building block for further development. Here are some potential continuations:
• Expand movement options: Include diagonal movements or introduce jumps of varying distances.
• Introduce obstacles: Create a grid with obstacles that the object must navigate around.
• Visualize the movement: Develop a program to display the object's movement path on a visual grid.
• Set goals and challenges: Incorporate goals or challenges for the object to reach based on the
movement instructions.