I'm new to java and I'm doing problems to get better. I'm trying to make a puzzle that gets the user input and moves the rows either to the left or right, the columns move either up or down depending on what the user wants. The problem I'm getting is a type mismatch for my RL method which moves the rows to the left.
you don't show us what the exact error is, and on what line it occurs. It is very helpful
to show us the full error message. Just copy the error message and paste it in your question..
But take a look at line 94. Variable 'board[j]' is an array of ints (to be more precise:
a pointer to an array of ints). The variable 'first' is an int (line 85).
So in effect, you try to assign an integer to an array.
If you use a 'two dimensional' array like in 'new board', then the first dimension
is an array of pointers to other arrays. So, board is a pointer to an array of
(in this case) 5 integers. Evenso board, et cetera.
That tells us you are using Eclipse and did what you shouldn't: run code with a red error mark on. You are using an array when you should have a number or vice versa. It should give you a line number (95), or you will have to look for the red mark. If you hover your mouse over the red mark you will get suggestions for corrections. They may not all be right.
In your code there's a big mistake that you are making. In your RL method you assign value to broad which is one dimensional array. However in the parameters of your RL method you have declared board as two dimensional array. Another mistake that you make is that when you use board as one dimensional array you leave the other dimension totally. Thus it contradicts.
So if you want to assign value to your board array you need to do it like this:
board[indexA][indexB] = value;
Where indexA is first dimensional index and indexB is the second dimensional index.