import java.util.Random; public class Tardis { private int energy; public Tardis(int startEnergy) { energy = startEnergy; } public int[] calculateCoordinates(int maxRow, int maxColumn) { Random aGenerator = new Random(); int [] newCoordinates = new int[2]; // Randomly generate a new set of (row,column) // values to move the tardis to. The randomly // generated value will be from 0 - (maxRow/maxColumn) // because those values dictate the size of the world // containing the tardis. newCoordinates[0] = aGenerator.nextInt(maxRow); newCoordinates[1] = aGenerator.nextInt(maxColumn); System.out.println("Tardis rematerializing at (r/c): " + newCoordinates[0] + "/" + newCoordinates[1]); energy--; return(newCoordinates); } }