Hello is there some algorithm which can generate random numbers in int[,](two dimentional array).
Let's say I have these numbers :
lets say that the blue circle is the current position in the array where the loop have to enter a number,but first I have to check all four directions(current =>down,up,left,right) and if the random number don't exist in these four directions then to enter it in.
My problem is that I don't know how to check all the drections without throwing a error and I don't want to use try & catch.
Thx in advance.