How can I get the last position in this jagged array?
<p>I have a class like this that im using as the point in the array:</p>

<pre><code>class Point
    {
        public int x;
        public int y;

        public Point(int x, int y)
        {
            this.x = x;
            this.y = y;
        }
    }
</code></pre>

<p>and then im trying to get the value that is closest to the end with this:</p>

<pre><code>public void Position()
        {
            for (int x = 0; x &lt; arr.Length; x++)
            {
                for (int y = 0; y &lt; arr[x].Length; y++)
                {
                    if (arr[x][y] == 3)
                        Pos.x = x;
                        Pos.y = y;
                    if (arr[x][y] == 1)
                        Pos.x = x;
                        Pos.y = y;
                    if (arr[x][y] == 2)
                        Pos.x = x;
                        Pos.y = y;
                }
            }
            Console.Write("Last Position: {0}, {1}",LastPos.x, LastPos.y);
        }
</code></pre>

<p>and i have this for the point:</p>

<pre><code>public Point Pos = new Point(0, 0);
</code></pre>

<p>Its a jagged array filled with all zeros except for a few points.  Looks like this:</p>

<p>0 0 0 3 0 0 0 0</p>

<p>0 0 1 0 0 0 0</p>

<p>0 0 0 2 0 0 0 0 </p>

<p>0 0 0 0 0 </p>

<p>0 0 0 0 0 0 0 </p>

<p>Where 2 is the closest to the end in this example. with a position of 2,3 which i want Pos.x and Pos.y to be.  It keeps giving me 0,30.</p>
