Try working on a solution for a single row, not a 2 dimensional array. When that works, then you can easily modify the logic to look at all the rows and the columns.
I gave you most of the logic...
Type: Posts; User: Norm
Try working on a solution for a single row, not a 2 dimensional array. When that works, then you can easily modify the logic to look at all the rows and the columns.
I gave you most of the logic...
A counter is how you know there are 3 in a row. You count them as you see them:
first there is one, then if the next number matches the first there are two
and then if the next number matches the...
Can you describe the logic for testing? Don't write any code until you have the logic.
My question was for searching one row. That would be a one dimensional array. The code you posted used a...
I don't see how the posted method looks at the contents of a row and tests if there are 3 identical elements in sequence. It would need a loop to do that.
Can you describe the logic to look at a...
Take it one step at a time.
How would the code look at the items in a row to see if there are three in a row?
Use a piece of paper, write some numbers in a row and work through the logic using...
How is that part of the problem of searching through an nxn grid looking for 3 in a row?
First look at the rows then look at the columns for 3 in a row.
The posted method has three arguments passed to it. What are they supposed to be used for?
It returns a 0 or a 1. What do they indicate?
A thought: check the rows one by one for 3 in a row and...
Does the code have to look through all rows and columns in a 5x6 grid looking for any sequence of 3 numbers in a row or column (not diagonal) with the same value?
Can you describe what the code should be doing and the steps it should take to do it?
Why is this test done: pos_x<2?
How are the colors of the pieces determined?