Closed SquidPony closed 7 years ago
With this code for (Coord coord : rng.getRandomUniqueCells(0, 0, map.width, map.height)) System.out.println("Testing map (" + map.width + ", " + map.height + ") found Coord: " + coord);
for (Coord coord : rng.getRandomUniqueCells(0, 0, map.width, map.height)) System.out.println("Testing map (" + map.width + ", " + map.height + ") found Coord: " + coord);
I'm getting this output Testing map (100, 50) found Coord: (45,83)
Testing map (100, 50) found Coord: (45,83)
My theory is that x and y are swapped somewhere
Good catch! Writing some tests now. I think I found what's causing the bug (you're probably right, it seems to have mixed up % and / for x and y), and I want to verify.
%
/
With this code
for (Coord coord : rng.getRandomUniqueCells(0, 0, map.width, map.height)) System.out.println("Testing map (" + map.width + ", " + map.height + ") found Coord: " + coord);
I'm getting this output
Testing map (100, 50) found Coord: (45,83)
My theory is that x and y are swapped somewhere