/**
* Replace instances of one value to another.
* @param from any element that matches this value will be replaced
* @param to with this value
*/
public void replace(int from, int to)
{
for (int x = 0; x < width; x++)
for (int y = 0; y < height; y++)
if (field[x][y] == from)
field[x][y] = to;
}
---
/**
* Replace instances of one value to another.
* @param from any element that matches this value will be replaced
* @param to with this value
*/
public void replace(double from, double to)
{
for (int x = 0; x < width; x++)
for (int y = 0; y < height; y++)
if (field[x][y] == from)
field[x][y] = to;
}
With Sean's permission, I'll check them in.
Joey