What have you already done?
Is the Bot built? Any code written?
How does the Bot detect the 'grid'?
Is the 'grid' lines on the floor? If so then state with a line follower and change the code to count grid lines.
The forum here has lots of info an discussions. Try searching for 'line following', and 'maze solving'.
If you need more basics then click on "Robot Tutorials" at the top right of this web page.