Please give me some pointers on why my code does not work for this assignment. My idea is to have an index (param) which is the current place in the Vector, and target (param) which is the value of the given index in the array. Then I either move up or down until reaching one of the base cases. But it don´t work.
The main problem is is that it outputs wrong results only false thus far.

bool RecursivePuzzle :: SolvableReal(Vector<int> & squares, int index, int target)
{
if (target == 0 && index == squares.size() ) return true;
if (index >= squares.size()) return false;
if (index < 0) return false;
int goUp = squares[index] + index;
int goDown = squares[index] - index;
return SolvableReal(squares, goUp, squares[index]) ||
SolvableReal(squares, goDown, squares[index]);
Probably not the whole answer, but this part looks wrong:
I think it should be