I've actually figure out how I'm going to do the diagonals now.
here's the code:
package stuff;
import java.io.File;
import java.io.FileNotFoundException;
Type: Posts; User: aesguitar
I've actually figure out how I'm going to do the diagonals now.
here's the code:
package stuff;
import java.io.File;
import java.io.FileNotFoundException;
same thing with vertically, but horizontally and vertically are easy to code.
The problem is asking for the greatest product of any four consecutive numbers in a grid. I have the numbers posted in a file above so you can tinker with a program. Increments of four meaning for...
Ok, that makes sense, but what about the other part of my question, how would I do it in increments of fours?
I understand the changes, as y goes down, x goes up, and vice versa. I just dont know how to code it.
in a 20x20 grid, there would be about 256 possible start locations going one direction.
I understand how it flows, for example:
0,0 0,1 0,2 0,3 0,4
1,0 1,1 1,2 1,3 1,4
2,0 2,1 2,2 2,3 2,4
3,0 3,1 3,2 3,3 3,4
4,0 4,1 4,2 4,3 4,4
I just don't understand how I...
Hi there, I'm working on a problem that involves finding a largest product of any 4 consecutive numbers in a grid. I don't want the answer to the question, but I can't figure out how to search...