Guest User

Untitled

a guest
Jun 25th, 2018
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. // Returns a string representation of the board.
  2.  
  3. public String toString()
  4.  
  5. {
  6. int count;
  7.  
  8. String display = " 1 2 3\n\n";
  9.  
  10. for (count = 0; count < board.length; count++)
  11.  
  12. {
  13.  
  14. display = display + ' ' + (char) (count + 97) + " " +
  15.  
  16. board[count][0] + " | " + board[count][1] + " |";
  17.  
  18. if (board[count][2] != ' ')
  19.  
  20. display = display + ' ' + board[count][2];
  21. if (count != (board.length - 1))
  22.  
  23. display = display + "\n ---+---+---\n";
  24. else
  25. display = display + "\n";
  26.  
  27. }
  28.  
  29. return display;
  30.  
  31. }
  32.  
  33. }
Add Comment
Please, Sign In to add comment