Edge avoider with pre-defined path

I m building a edge avoider robot but i want it to follow a definite path (refer to image) that is when my robot is kept at any surface of any length or breadth then it should follow this path depending upon its edge…

OK, that sounds feasible. You'll need to choose the hardware, design the circuit to connect the hardware to your Arduino and write the Arduino sketch to control it. You should be able to find plenty of examples of line following robots for inspiration.

I am making an edge avaoiding bot using arduino and IR sensors but have difficulty with the code can I please get the arduino code .. :)