293031323334353637
Ghost theGhost = getRandomGhost(); if (theGhost == null) { return; } int dirIndex = getRandomizer().nextInt(Direction.values().length); final Direction dir = Direction.values()[dirIndex]; gameInteraction().moveGhost(theGhost, dir); } }