Looks like to need to learn some analyze methods.
You need to proceed in order
Quote:
Imagine a robot sitting on the upper left hand corner of an NxN grid.
The robot has to reach the lower right hand corner of the NxN grid.
Imagine certain squares are “off limits” or “offsets”, such that the robot cannot step on them.
You need a grid of size NxN where you will remember positions that are off limits.
Quote:
The robot can only move in three directions: right , down and diagonally down.
Write a program to determine the number of possible paths for the robot.
You need to count all paths. which means that the robot can choose one of the 3 directions as long as the move do not hit a border of the grid or an off limit position.
This is a typical recursive problem: you need to write a function with actual position, if position is final position, it is a new path, otherwise for each moves, you check if move is allowed, and if allowed, call this same function with new position.
Either you do it with an explicit recursive function, or with implicit recursion using backtracking.
We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
Any failure of you will help you to learn what works and what don't, it is called 'trial and error' learning.
As programmer,
your job is to create algorithms that solve specific problems and you can't rely on someone else to eternally do it for you, so there is a time where you will have to learn how to.
Creating an algorithm is basically finding the maths and make necessary adaptation to fit your actual problem.