MCPcopy Index your code
hub / github.com/coding-parrot/chess-engine / toString

Method toString

src/main/java/game/Board.java:818–836  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

816 }
817
818 @Override
819 public String toString() {
820 final StringBuilder stringBuilder = new StringBuilder();
821 for (int i = 7; i >= 0; i--) {
822 for (int j = 0; j < 8; j++) {
823 if (isEmpty(i, j)) {
824 stringBuilder.append((i + j) % 2 == 0 ? "◻" : "◼");
825 } else {
826 stringBuilder.append(getPiece(i, j).getShortForm());
827 }
828 }
829 stringBuilder.append('\n');
830 }
831 stringBuilder.append("{\npieces=")
832 .append(pieces).append('\n')
833 .append("moveList=").append(moveList).append('\n')
834 .append("inCheck: ").append(inCheck).append("\n}");
835 return stringBuilder.toString();
836 }
837
838 public String fenRepresentation() {
839 final StringBuilder stringBuilder = new StringBuilder();

Callers 1

fenRepresentationMethod · 0.45

Calls 3

isEmptyMethod · 0.95
getPieceMethod · 0.95
getShortFormMethod · 0.80

Tested by

no test coverage detected