Thanks for the help

I Will post in the correct forum from now on

.
I thought "Move Backward" was allowed.
But I realized because the triangle is getting wide, and position 0 becomes farther left each line, you can never decrement your position index.
However, when I remove the MoveBackward functionality in my program, my answer is off by * in the solution.
My output is now as follows:
Code: Select all
75 0 0 0 0 0 0 0 0 0 0 0 0 0 0
95 64 0 0 0 0 0 0 0 0 0 0 0 0 0
17 47 82 0 0 0 0 0 0 0 0 0 0 0 0
18 35 87 10 0 0 0 0 0 0 0 0 0 0 0
20 4 82 47 65 0 0 0 0 0 0 0 0 0 0
19 1 23 75 3 34 0 0 0 0 0 0 0 0 0
88 2 77 73 7 63 67 0 0 0 0 0 0 0 0
99 65 4 28 6 16 70 92 0 0 0 0 0 0 0
41 41 26 56 83 40 80 70 33 0 0 0 0 0 0
41 48 72 33 47 32 37 16 94 29 0 0 0 0 0
53 71 44 65 25 43 91 52 97 51 14 0 0 0 0
70 11 33 28 77 73 17 78 39 68 17 57 0 0 0
91 71 52 38 17 14 91 43 58 50 27 29 48 0 0
63 66 4 68 89 53 67 30 73 16 69 87 40 31 0
4 62 98 27 23 9 70 98 73 93 38 53 60 4 23
Moved Down: 75 Last Position: 0
Moved Down: 95 Last Position: 0
Moved Forward: 47 Last Position: 1
Moved Forward: 87 Last Position: 2
Moved Down: 82 Last Position: 2
Moved Forward: 75 Last Position: 3
Moved Down: 73 Last Position: 3
Moved Down: 28 Last Position: 3
Moved Forward: 83 Last Position: 4
Moved Down: 47 Last Position: 4
Moved Forward: 43 Last Position: 5
Moved Down: 73 Last Position: 5
Moved Forward: 91 Last Position: 6
Moved Down: 67 Last Position: 6
Moved Forward: 98 Last Position: 7
The largest sum using adjacent squares is: {skipped by hk]
Press any key to continue . . .
And with the small sample triangle I get the output:
Code: Select all
1 0 0 0
2 1 0 0
1 1 9 0
1 1 1 9
Moved Down: 1 Last Position: 0
Moved Down: 2 Last Position: 0
The largest sum using adjacent squares is: 3
Press any key to continue . . .
I have found out my main problem (among other things), is that I am only looking at the next row, and picking the best available value, when in fact, there is one row in the triangle where you have to choose the lower immediate value, in order to reach the maximum sum overall in the triangle. Have to rethink my approach here.