Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1.    if(startIndex == endIndex)
  2.     {
  3.         return board[startIndex];
  4.     }
  5.     else if(board[startIndex+1] < board[startIndex+2])
  6.     {
  7.         return board[startIndex] + jumpIt(board, ++startIndex, endIndex);
  8.     }
  9.     else if(board[startIndex+1] > board[startIndex+2])
  10.     {
  11.         if(startIndex == (endIndex-1))
  12.         {
  13.              return board[startIndex] + jumpIt(board, startIndex+1, endIndex);
  14.         }
  15.         return board[startIndex] + jumpIt(board, startIndex+2, endIndex);
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement