import java.util.Random; public class MapElement { private char appearance; // Random initialization // 1/3 blank appearance (space) // 1/3 appearance is '#' // 1/3 appearance is '!' public MapElement() { Random r = new Random(); int temp = r.nextInt(3)+1; switch(temp) { case 1: appearance = ' '; break; case 2: appearance = '#'; break; case 3: appearance = '!'; break; } } public char getAppearance() { return(appearance); } public void setAppearance(char anAppearance) { appearance = anAppearance; } }