Advertisement
Guest User

Game.toString

a guest
Apr 4th, 2014
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1.     public String toString() {
  2.         StringBuilder s = new StringBuilder("<html>");
  3.         for (ArrayList<ArrayList<Animal>> row : board) {
  4.             for (ArrayList<Animal> cell : row) {
  5.                 if (cell.isEmpty())
  6.                     s.append("&nbsp;&nbsp;");
  7.                 else
  8.             s.append(cell.get(0).letter).append("&nbsp;");
  9.             }
  10.             s.append("<br>");
  11.         }
  12.         s.append("</html>");
  13.         return s.toString();
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement