a b c d e f g
+---+---+---+
7 | * | * | * | 7
+---+---+---+
6 | * | * | * | 6
+---+---+---+---+---+---+---+
5 | * | * | * | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | * | * | * | | * | * | * | 4
+---+---+---+---+---+---+---+
3 | * | * | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | * | * | * | 2
+---+---+---+
1 | * | * | * | 1
+---+---+---+
a b c d e f g
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | | | 6
+---+---+---+---+---+---+---+
5 | | | | | | | | 5
+---+---+---+---+---+---+---+
4 | | | | * | | | | 4
+---+---+---+---+---+---+---+
3 | | | | | | | | 3
+---+---+---+---+---+---+---+
2 | | | | 2
+---+---+---+
1 | | | | 1
+---+---+---+
a b c d e f g
Solitaire-Brett,
auf dem die Spielsteine liegen und bewegt werden können.
Dieses Brett gibt z. B. auch Auskunft darüber, ob die Endsituation erreicht ist.
Solitaire-Zug.
import java.util.Collections;
import java.util.LinkedList;
import java.util.ListIterator;
/**
* Gekapselter Suchalgorithmus (Tiefensuche) zum Solitaire-Spiel.
* Das Suchergebnis ist eine Lösung des Spieles, eine Beschreibung der
* nacheinander auszuführenden Züge.
*/
public class Solitaire {
/**
* Sucht irgendeine Lösung zum gegebenen Solitaire-Brett.
* Vorsicht: Großer Suchraum; Lösung lässt sehr lange auf sich warten!
* @param board das initiale Brett.
* @param plan Zugfolge, die zur Lösung führt.
* @return true, wenn eine Lösung gefunden wurde.
*/
private boolean solve(Board board, LinkedList<Move> plan) {
if (board.isFinished()) {
// Die Suche terminiert, falls eine Lösung vorliegt.
return true;
} else {
// Andernfalls wird die Suche
// mit allen möglichen Folgezügen fortgesetzt.
LinkedList<Move> adjacences = board.getMoves();
// beliebige Reihenfolge der Folgezüge
Collections.shuffle(adjacences);
while (!adjacences.isEmpty()) {
Move adjacence = adjacences.removeFirst();
board.doMove(adjacence);
plan.addLast(adjacence);
// Rekursion mit dem erweiterten Plan
if (this.solve(board, plan)) {
// Die Suche terminiert, wenn in der Rekursion
// eine Lösung gefunden wird.
return true;
}
// Falls der letzte Zug zu keiner Lösung
// geführt haben sollte, so muss dieser aus dem Plan
// entfernt und wieder rückgängig gemacht werden.
plan.removeLast();
board.redoMove(adjacence);
}
return false;
}
}
/**
* Stößt die Suche bzgl. der Ausgangssituation eines Solitaire-Spieles an
* und liefert irgendeine beliebige, aber gültige Lösung.
* @return Zugfolge, die zur Lösung führt.
*/
public LinkedList<Move> solve() {
LinkedList<Move> result = new LinkedList<Move>();
this.solve(new Board(), result);
return result;
}
/**
* Das Hauptprogramm zur Lösung des Solitaire-Spieles.
* @param arguments Die Argumente werden nicht verwendet.
*/
public static void main(String[] arguments) {
// Planberechnung und -ausgabe
Solitaire solitaire = new Solitaire();
LinkedList<Move> plan = solitaire.solve();
System.out.println(movesToString(plan));
System.out.println();
// Anwendung des Plans auf dem Brett
Board board = new Board();
System.out.println(board);
while (!plan.isEmpty()) {
Move move = plan.removeFirst();
System.out.println(move);
board.doMove(move);
System.out.println(board);
}
}
/**
* Erzeugt eine textuelle Repräsentation einer Zugfolge.
* @param moves die Zugfolge
* @return die textuelle Repräsentation einer Zugfolge
*/
private static String movesToString(LinkedList<Move> moves) {
if (moves.isEmpty()) {
return "no plan";
} else {
String result = "";
ListIterator<Move> iter = moves.listIterator();
while (iter.hasNext()) {
if (iter.nextIndex() > 0) {
result += ".";
if (iter.nextIndex() % 8 == 0) {
result += "\n";
}
}
result += iter.next().toString();
}
return result;
}
}
}
import java.util.LinkedList;
/**
* Repräsention eines Solitaire-Bretts mit einigen hilfreichen Methoden,
* die das Ausführen von Spielzügen (Aktionen) auf dem Spielbrett
* ermöglichen.
*/
public class Board {
/**
* Interne Repräsentation des Solitaire-Brettes
* als boolsche 2D-Matrix.
* true bedeutet Feld belegt, false bedeutet Feld frei.
*/
private boolean[][] board;
/**
* Instantiiert ein Solitaire-Brett mit der Start-Aufstellung.
*/
public Board() {
this.board = new boolean[7][7];
for (int x = 0; x < 7; x++) {
for (int y = 0; y < 7; y++) {
this.board[x][y] = true;
}
}
this.board[3][3] = false;
}
/**
* Prüft, ob es sich um die Endstellung handelt.
* @return true, falls es sich um die Endstellung handelt.
*/
public boolean isFinished() {
// Falls das mittlere Feld besetzt ist,
// genau prüfen, ob es sich um die Endstellung handelt
// (Optimierung).
if (this.board[3][3]) {
return (!this.board[2][0])
&& (!this.board[3][0])
&& (!this.board[4][0])
&& (!this.board[2][1])
&& (!this.board[3][1])
&& (!this.board[4][1])
&& (!this.board[0][2])
&& (!this.board[1][2])
&& (!this.board[2][2])
&& (!this.board[3][2])
&& (!this.board[4][2])
&& (!this.board[5][2])
&& (!this.board[6][2])
&& (!this.board[0][3])
&& (!this.board[1][3])
&& (!this.board[2][3])
&& (!this.board[4][3])
&& (!this.board[5][3])
&& (!this.board[6][3])
&& (!this.board[0][4])
&& (!this.board[1][4])
&& (!this.board[2][4])
&& (!this.board[3][4])
&& (!this.board[4][4])
&& (!this.board[5][4])
&& (!this.board[6][4])
&& (!this.board[2][5])
&& (!this.board[3][5])
&& (!this.board[4][5])
&& (!this.board[2][6])
&& (!this.board[3][6])
&& (!this.board[4][6]);
} else {
return false;
}
}
/**
* Prüft, ob es sich um eine Feld-Koordinate handelt. Die
* Implementierung ist hier sehr ineffizient,
* effizienter mit Lookup-Matrix.
* @param x die horizontale Komponente.
* @param y die vertikale Komponente.
* @return true, falls es sich um eine Feld-Koordinate handelt.
*/
public boolean isField(int x, int y) {
return ((0 <= x) && (x < 7) && (0 <= y) && (y < 7))
&& (!((0 <= x) && (x < 2) && (0 <= y) && (y < 2)))
&& (!((0 <= x) && (x < 2) && (5 <= y) && (y < 7)))
&& (!((5 <= x) && (x < 7) && (0 <= y) && (y < 2)))
&& (!((5 <= x) && (x < 7) && (5 <= y) && (y < 7)));
}
/**
* Prüft, ob ein Zug auf dem Brett ausgeführt werden kann.
* @param xFrom die x-Komponente vom Startpunkt des Zuges.
* @param yFrom die y-Komponente vom Startpunkt des Zuges.
* @param xTo die x-Komponente vom Endpunkt des Zuges.
* @param yTo die y-Komponente vom Endpunkt des Zuges.
* @return true, falls der Zug ausgeführt werden kann.
*/
public boolean canDoMove(int xFrom, int yFrom, int xTo, int yTo) {
return
// Ist From-Feld belegt?
(this.isField(xFrom, yFrom)) && (this.board[xFrom][yFrom]) &&
// Ist To-Feld frei?
(this.isField(xTo, yTo)) && (!this.board[xTo][yTo]) &&
// Ist Mittelfeld belegt?
(this.board[(xFrom + xTo) / 2][(yFrom + yTo) / 2]);
}
/**
* Führt einen Zug (Aktion) auf dem Brett aus.
* @param action der Zug.
*/
public void doMove(Move action) {
if (this.canDoMove(action.xFrom, action.yFrom,
action.xTo, action.yTo)) {
// From-Feld leeren
this.board[action.xFrom][action.yFrom] = false;
// To-Feld besetzen
this.board[action.xTo][action.yTo] = true;
// Mittelfeld leeren
this.board[(action.xFrom + action.xTo) / 2]
[(action.yFrom + action.yTo) / 2] = false;
}
}
/**
* Prüft, ob ein Zug auf dem Brett zurückgenommen werden kann.
* @param xFrom die x-Komponente vom Startpunkt des Zuges.
* @param yFrom die y-Komponente vom Startpunkt des Zuges.
* @param xTo die x-Komponente vom Endpunkt des Zuges.
* @param yTo die y-Komponente vom Endpunkt des Zuges.
* @return true, falls der Zug zurückgenommen werden kann.
*/
public boolean canRedoMove(int xFrom, int yFrom, int xTo, int yTo) {
return
// Ist From-Feld frei?
(this.isField(xFrom, yFrom)) && (!this.board[xFrom][yFrom]) &&
// Ist To-Feld belegt?
(this.isField(xTo, yTo)) && (this.board[xTo][yTo]) &&
// Ist Mittelfeld frei?
(!this.board[(xFrom + xTo) / 2][(yFrom + yTo) / 2]);
}
/**
* Nimmt einen Zug (Redo-Aktion) auf dem Brett zurück.
* @param action die Zugrücknahme.
*/
public void redoMove(Move action) {
if (this.canRedoMove(action.xFrom, action.yFrom,
action.xTo, action.yTo)) {
// From-Feld besetzen
this.board[action.xFrom][action.yFrom] = true;
// To-Feld leeren
this.board[action.xTo][action.yTo] = false;
// Mittelfeld besetzen
this.board[(action.xFrom + action.xTo) / 2]
[(action.yFrom + action.yTo) / 2] = true;
}
}
/**
* Liefert alle möglichen Züge, die auf dem angegebenen Feld
* ausgeführt werden können.
* @param x die x-Komponente des Feldes.
* @param y die y-Komponente des Feldes.
* @return Die Liste aller möglichen Züge bzgl. Feld(x,y).
*/
private LinkedList<Move> getMovesOfField(int x, int y) {
LinkedList<Move> result = new LinkedList<Move>();
if (this.isField(x, y)) {
if (this.canDoMove(x, y, x - 2, y)) {
result.add(new Move(x, y, x - 2, y));
}
if (this.canDoMove(x, y, x + 2, y)) {
result.add(new Move(x, y, x + 2, y));
}
if (this.canDoMove(x, y, x, y - 2)) {
result.add(new Move(x, y, x, y - 2));
}
if (this.canDoMove(x, y, x, y + 2)) {
result.add(new Move(x, y, x, y + 2));
}
}
return result;
}
/**
* Liefert alle möglichen Züge zur aktuellen Brettsituation.
* @return Die Liste aller möglichen Züge.
*/
public LinkedList<Move> getMoves() {
LinkedList<Move> result = new LinkedList<Move>();
for (int x = 0; x < 7; x++) {
for (int y = 0; y < 7; y++) {
result.addAll(this.getMovesOfField(x, y));
}
}
return result;
}
/**
* Gibt die textuelle Repräsentation eines Feldes zurück.
* @param x die x-Komponente des Feldes.
* @param y die y-Komponente des Feldes.
* @return die textuelle Feld-Repräsentation.
*/
private String pieceToString(int x, int y) {
return ((this.isField(x, y)) && (this.board[x][y])) ? "*" : " ";
}
/**
* Gibt die textuelle Repräsentation des Brettes zurück.
* @return die textuelle Brett-Repräsentation.
*/
public String toString() {
String result = "";
result += " a b c d e f g " + "\r\n";
result += " +---+---+---+ " + "\r\n";
result += "7 | " + this.pieceToString(2, 0);
result += " | " + this.pieceToString(3, 0);
result += " | " + this.pieceToString(4, 0);
result += " | 7" + "\r\n";
result += " +---+---+---+ " + "\r\n";
result += "6 | " + this.pieceToString(2, 1);
result += " | " + this.pieceToString(3, 1);
result += " | " + this.pieceToString(4, 1);
result += " | 6" + "\r\n";
result += " +---+---+---+---+---+---+---+ " + "\r\n";
result += "5 | " + this.pieceToString(0, 2);
result += " | " + this.pieceToString(1, 2);
result += " | " + this.pieceToString(2, 2);
result += " | " + this.pieceToString(3, 2);
result += " | " + this.pieceToString(4, 2);
result += " | " + this.pieceToString(5, 2);
result += " | " + this.pieceToString(6, 2);
result += " | 5" + "\r\n";
result += " +---+---+---+---+---+---+---+ " + "\r\n";
result += "4 | " + this.pieceToString(0, 3);
result += " | " + this.pieceToString(1, 3);
result += " | " + this.pieceToString(2, 3);
result += " | " + this.pieceToString(3, 3);
result += " | " + this.pieceToString(4, 3);
result += " | " + this.pieceToString(5, 3);
result += " | " + this.pieceToString(6, 3);
result += " | 4" + "\r\n";
result += " +---+---+---+---+---+---+---+ " + "\r\n";
result += "3 | " + this.pieceToString(0, 4);
result += " | " + this.pieceToString(1, 4);
result += " | " + this.pieceToString(2, 4);
result += " | " + this.pieceToString(3, 4);
result += " | " + this.pieceToString(4, 4);
result += " | " + this.pieceToString(5, 4);
result += " | " + this.pieceToString(6, 4);
result += " | 3" + "\r\n";
result += " +---+---+---+---+---+---+---+ " + "\r\n";
result += "2 | " + this.pieceToString(2, 5);
result += " | " + this.pieceToString(3, 5);
result += " | " + this.pieceToString(4, 5);
result += " | 2" + "\r\n";
result += " +---+---+---+ " + "\r\n";
result += "1 | " + this.pieceToString(2, 6);
result += " | " + this.pieceToString(3, 6);
result += " | " + this.pieceToString(4, 6);
result += " | 1" + "\r\n";
result += " +---+---+---+ " + "\r\n";
result += " a b c d e f g ";
return result;
}
}
/**
* Repräsention eines Zuges im Solitaire-Spiel.
*/
public class Move {
/**
* Die x-Komponente vom Startpunkt des Zuges.
*/
public int xFrom;
/**
* Die y-Komponente vom Startpunkt des Zuges.
*/
public int yFrom;
/**
* Die x-Komponente vom Endpunkt des Zuges.
*/
public int xTo;
/**
* Die y-Komponente vom Endpunkt des Zuges.
*/
public int yTo;
/**
* Instantiiert einen Solitaire-Zug.
* @param xFrom die x-Komponente vom Startpunkt des Zuges.
* @param yFrom die y-Komponente vom Startpunkt des Zuges.
* @param xTo die x-Komponente vom Endpunkt des Zuges.
* @param yTo die y-Komponente vom Endpunkt des Zuges.
*/
public Move(int xFrom, int yFrom, int xTo, int yTo) {
this.xFrom = xFrom;
this.yFrom = yFrom;
this.xTo = xTo;
this.yTo = yTo;
}
/**
* Gibt die textuelle Repräsentation einer Feld-Koordinate zurück.
* @param x die x-Komponente der Feld-Koordinate.
* @param y die y-Komponente der Feld-Koordinate.
* @return die textuelle Feld-Koordinaten-Repräsentation, wie beim Schach.
*/
private String coordinateToString(int x, int y) {
if ((0 <= x) && (x < 7)) {
String alpha = "abcdefg";
return "" + alpha.charAt(x) + (7 - y);
} else {
return "" + x + (7 - y);
}
}
/**
* Gibt die textuelle Repräsentation des Zuges zurück.
* @return die textuelle Zug-Repräsentation.
*/
public String toString() {
return "(" + this.coordinateToString(this.xFrom, this.yFrom)
+ "->" + this.coordinateToString(this.xTo, this.yTo) + ")";
}
}
Collections.shuffle(adjacences);
C:\> java Solitaire
(b4->d4).(c6->c4).(a5->c5).(a3->a5).(c4->c6).(c7->c5).(c3->a3).(c1->c3).
(d5->b5).(a5->c5).(d7->d5).(d5->b5).(d3->b3).(a3->c3).(d1->d3).(d3->b3).
(f5->d5).(e7->e5).(e5->c5).(b5->d5).(d5->d3).(e3->c3).(b3->d3).(e1->e3).
(e4->e2).(g3->e3).(d3->f3).(g5->g3).(g3->e3).(e2->e4).(f4->d4)
a b c d e f g
+---+---+---+
7 | * | * | * | 7
+---+---+---+
6 | * | * | * | 6
+---+---+---+---+---+---+---+
5 | * | * | * | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | * | * | * | | * | * | * | 4
+---+---+---+---+---+---+---+
3 | * | * | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | * | * | * | 2
+---+---+---+
1 | * | * | * | 1
+---+---+---+
a b c d e f g
(b4->d4)
a b c d e f g
+---+---+---+
7 | * | * | * | 7
+---+---+---+
6 | * | * | * | 6
+---+---+---+---+---+---+---+
5 | * | * | * | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | * | | | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | * | * | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | * | * | * | 2
+---+---+---+
1 | * | * | * | 1
+---+---+---+
a b c d e f g
(c6->c4)
a b c d e f g
+---+---+---+
7 | * | * | * | 7
+---+---+---+
6 | | * | * | 6
+---+---+---+---+---+---+---+
5 | * | * | | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | * | | * | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | * | * | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | * | * | * | 2
+---+---+---+
1 | * | * | * | 1
+---+---+---+
a b c d e f g
(a5->c5)
a b c d e f g
+---+---+---+
7 | * | * | * | 7
+---+---+---+
6 | | * | * | 6
+---+---+---+---+---+---+---+
5 | | | * | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | * | | * | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | * | * | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | * | * | * | 2
+---+---+---+
1 | * | * | * | 1
+---+---+---+
a b c d e f g
(a3->a5)
a b c d e f g
+---+---+---+
7 | * | * | * | 7
+---+---+---+
6 | | * | * | 6
+---+---+---+---+---+---+---+
5 | * | | * | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | | | * | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | | * | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | * | * | * | 2
+---+---+---+
1 | * | * | * | 1
+---+---+---+
a b c d e f g
(c4->c6)
a b c d e f g
+---+---+---+
7 | * | * | * | 7
+---+---+---+
6 | * | * | * | 6
+---+---+---+---+---+---+---+
5 | * | | | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | | | | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | | * | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | * | * | * | 2
+---+---+---+
1 | * | * | * | 1
+---+---+---+
a b c d e f g
(c7->c5)
a b c d e f g
+---+---+---+
7 | | * | * | 7
+---+---+---+
6 | | * | * | 6
+---+---+---+---+---+---+---+
5 | * | | * | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | | | | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | | * | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | * | * | * | 2
+---+---+---+
1 | * | * | * | 1
+---+---+---+
a b c d e f g
(c3->a3)
a b c d e f g
+---+---+---+
7 | | * | * | 7
+---+---+---+
6 | | * | * | 6
+---+---+---+---+---+---+---+
5 | * | | * | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | | | | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | * | | | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | * | * | * | 2
+---+---+---+
1 | * | * | * | 1
+---+---+---+
a b c d e f g
(c1->c3)
a b c d e f g
+---+---+---+
7 | | * | * | 7
+---+---+---+
6 | | * | * | 6
+---+---+---+---+---+---+---+
5 | * | | * | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | | | | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | * | | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | * | * | 2
+---+---+---+
1 | | * | * | 1
+---+---+---+
a b c d e f g
(d5->b5)
a b c d e f g
+---+---+---+
7 | | * | * | 7
+---+---+---+
6 | | * | * | 6
+---+---+---+---+---+---+---+
5 | * | * | | | * | * | * | 5
+---+---+---+---+---+---+---+
4 | | | | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | * | | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | * | * | 2
+---+---+---+
1 | | * | * | 1
+---+---+---+
a b c d e f g
(a5->c5)
a b c d e f g
+---+---+---+
7 | | * | * | 7
+---+---+---+
6 | | * | * | 6
+---+---+---+---+---+---+---+
5 | | | * | | * | * | * | 5
+---+---+---+---+---+---+---+
4 | | | | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | * | | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | * | * | 2
+---+---+---+
1 | | * | * | 1
+---+---+---+
a b c d e f g
(d7->d5)
a b c d e f g
+---+---+---+
7 | | | * | 7
+---+---+---+
6 | | | * | 6
+---+---+---+---+---+---+---+
5 | | | * | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | | | | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | * | | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | * | * | 2
+---+---+---+
1 | | * | * | 1
+---+---+---+
a b c d e f g
(d5->b5)
a b c d e f g
+---+---+---+
7 | | | * | 7
+---+---+---+
6 | | | * | 6
+---+---+---+---+---+---+---+
5 | | * | | | * | * | * | 5
+---+---+---+---+---+---+---+
4 | | | | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | * | | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | * | * | 2
+---+---+---+
1 | | * | * | 1
+---+---+---+
a b c d e f g
(d3->b3)
a b c d e f g
+---+---+---+
7 | | | * | 7
+---+---+---+
6 | | | * | 6
+---+---+---+---+---+---+---+
5 | | * | | | * | * | * | 5
+---+---+---+---+---+---+---+
4 | | | | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | * | * | | | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | * | * | 2
+---+---+---+
1 | | * | * | 1
+---+---+---+
a b c d e f g
(a3->c3)
a b c d e f g
+---+---+---+
7 | | | * | 7
+---+---+---+
6 | | | * | 6
+---+---+---+---+---+---+---+
5 | | * | | | * | * | * | 5
+---+---+---+---+---+---+---+
4 | | | | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | | | * | | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | * | * | 2
+---+---+---+
1 | | * | * | 1
+---+---+---+
a b c d e f g
(d1->d3)
a b c d e f g
+---+---+---+
7 | | | * | 7
+---+---+---+
6 | | | * | 6
+---+---+---+---+---+---+---+
5 | | * | | | * | * | * | 5
+---+---+---+---+---+---+---+
4 | | | | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | | | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | | * | 2
+---+---+---+
1 | | | * | 1
+---+---+---+
a b c d e f g
(d3->b3)
a b c d e f g
+---+---+---+
7 | | | * | 7
+---+---+---+
6 | | | * | 6
+---+---+---+---+---+---+---+
5 | | * | | | * | * | * | 5
+---+---+---+---+---+---+---+
4 | | | | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | | * | | | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | | * | 2
+---+---+---+
1 | | | * | 1
+---+---+---+
a b c d e f g
(f5->d5)
a b c d e f g
+---+---+---+
7 | | | * | 7
+---+---+---+
6 | | | * | 6
+---+---+---+---+---+---+---+
5 | | * | | * | | | * | 5
+---+---+---+---+---+---+---+
4 | | | | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | | * | | | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | | * | 2
+---+---+---+
1 | | | * | 1
+---+---+---+
a b c d e f g
(e7->e5)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | | | 6
+---+---+---+---+---+---+---+
5 | | * | | * | * | | * | 5
+---+---+---+---+---+---+---+
4 | | | | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | | * | | | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | | * | 2
+---+---+---+
1 | | | * | 1
+---+---+---+
a b c d e f g
(e5->c5)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | | | 6
+---+---+---+---+---+---+---+
5 | | * | * | | | | * | 5
+---+---+---+---+---+---+---+
4 | | | | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | | * | | | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | | * | 2
+---+---+---+
1 | | | * | 1
+---+---+---+
a b c d e f g
(b5->d5)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | | | 6
+---+---+---+---+---+---+---+
5 | | | | * | | | * | 5
+---+---+---+---+---+---+---+
4 | | | | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | | * | | | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | | * | 2
+---+---+---+
1 | | | * | 1
+---+---+---+
a b c d e f g
(d5->d3)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | | | 6
+---+---+---+---+---+---+---+
5 | | | | | | | * | 5
+---+---+---+---+---+---+---+
4 | | | | | * | * | * | 4
+---+---+---+---+---+---+---+
3 | | * | | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | | * | 2
+---+---+---+
1 | | | * | 1
+---+---+---+
a b c d e f g
(e3->c3)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | | | 6
+---+---+---+---+---+---+---+
5 | | | | | | | * | 5
+---+---+---+---+---+---+---+
4 | | | | | * | * | * | 4
+---+---+---+---+---+---+---+
3 | | * | * | | | * | * | 3
+---+---+---+---+---+---+---+
2 | | | * | 2
+---+---+---+
1 | | | * | 1
+---+---+---+
a b c d e f g
(b3->d3)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | | | 6
+---+---+---+---+---+---+---+
5 | | | | | | | * | 5
+---+---+---+---+---+---+---+
4 | | | | | * | * | * | 4
+---+---+---+---+---+---+---+
3 | | | | * | | * | * | 3
+---+---+---+---+---+---+---+
2 | | | * | 2
+---+---+---+
1 | | | * | 1
+---+---+---+
a b c d e f g
(e1->e3)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | | | 6
+---+---+---+---+---+---+---+
5 | | | | | | | * | 5
+---+---+---+---+---+---+---+
4 | | | | | * | * | * | 4
+---+---+---+---+---+---+---+
3 | | | | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | | | 2
+---+---+---+
1 | | | | 1
+---+---+---+
a b c d e f g
(e4->e2)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | | | 6
+---+---+---+---+---+---+---+
5 | | | | | | | * | 5
+---+---+---+---+---+---+---+
4 | | | | | | * | * | 4
+---+---+---+---+---+---+---+
3 | | | | * | | * | * | 3
+---+---+---+---+---+---+---+
2 | | | * | 2
+---+---+---+
1 | | | | 1
+---+---+---+
a b c d e f g
(g3->e3)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | | | 6
+---+---+---+---+---+---+---+
5 | | | | | | | * | 5
+---+---+---+---+---+---+---+
4 | | | | | | * | * | 4
+---+---+---+---+---+---+---+
3 | | | | * | * | | | 3
+---+---+---+---+---+---+---+
2 | | | * | 2
+---+---+---+
1 | | | | 1
+---+---+---+
a b c d e f g
(d3->f3)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | | | 6
+---+---+---+---+---+---+---+
5 | | | | | | | * | 5
+---+---+---+---+---+---+---+
4 | | | | | | * | * | 4
+---+---+---+---+---+---+---+
3 | | | | | | * | | 3
+---+---+---+---+---+---+---+
2 | | | * | 2
+---+---+---+
1 | | | | 1
+---+---+---+
a b c d e f g
(g5->g3)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | | | 6
+---+---+---+---+---+---+---+
5 | | | | | | | | 5
+---+---+---+---+---+---+---+
4 | | | | | | * | | 4
+---+---+---+---+---+---+---+
3 | | | | | | * | * | 3
+---+---+---+---+---+---+---+
2 | | | * | 2
+---+---+---+
1 | | | | 1
+---+---+---+
a b c d e f g
(g3->e3)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | | | 6
+---+---+---+---+---+---+---+
5 | | | | | | | | 5
+---+---+---+---+---+---+---+
4 | | | | | | * | | 4
+---+---+---+---+---+---+---+
3 | | | | | * | | | 3
+---+---+---+---+---+---+---+
2 | | | * | 2
+---+---+---+
1 | | | | 1
+---+---+---+
a b c d e f g
(e2->e4)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | | | 6
+---+---+---+---+---+---+---+
5 | | | | | | | | 5
+---+---+---+---+---+---+---+
4 | | | | | * | * | | 4
+---+---+---+---+---+---+---+
3 | | | | | | | | 3
+---+---+---+---+---+---+---+
2 | | | | 2
+---+---+---+
1 | | | | 1
+---+---+---+
a b c d e f g
(f4->d4)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | | | 6
+---+---+---+---+---+---+---+
5 | | | | | | | | 5
+---+---+---+---+---+---+---+
4 | | | | * | | | | 4
+---+---+---+---+---+---+---+
3 | | | | | | | | 3
+---+---+---+---+---+---+---+
2 | | | | 2
+---+---+---+
1 | | | | 1
+---+---+---+
a b c d e f g
(b4->d4).(c2->c4).(c5->c3).(e4->c4).(c7->c5).(g4->e4).(e2->c2).(c4->c6).
(e7->c7).(e4->e2).(c2->c4).(e1->e3).(e5->c5).(g5->e5).(b5->d5).(a3->c3).
(a5->a3).(c7->c5).(d5->b5).(e6->e4).(c1->e1).(e4->e2).(g3->e3).(d3->f3).
(e1->e3).(f3->d3).(d3->b3).(a3->c3).(c3->c5).(b5->d5).(d6->d4)
a b c d e f g
+---+---+---+
7 | * | * | * | 7
+---+---+---+
6 | * | * | * | 6
+---+---+---+---+---+---+---+
5 | * | * | * | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | * | * | * | | * | * | * | 4
+---+---+---+---+---+---+---+
3 | * | * | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | * | * | * | 2
+---+---+---+
1 | * | * | * | 1
+---+---+---+
a b c d e f g
(b4->d4)
a b c d e f g
+---+---+---+
7 | * | * | * | 7
+---+---+---+
6 | * | * | * | 6
+---+---+---+---+---+---+---+
5 | * | * | * | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | * | | | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | * | * | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | * | * | * | 2
+---+---+---+
1 | * | * | * | 1
+---+---+---+
a b c d e f g
(c2->c4)
a b c d e f g
+---+---+---+
7 | * | * | * | 7
+---+---+---+
6 | * | * | * | 6
+---+---+---+---+---+---+---+
5 | * | * | * | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | * | | * | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | * | * | | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | * | * | 2
+---+---+---+
1 | * | * | * | 1
+---+---+---+
a b c d e f g
(c5->c3)
a b c d e f g
+---+---+---+
7 | * | * | * | 7
+---+---+---+
6 | * | * | * | 6
+---+---+---+---+---+---+---+
5 | * | * | | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | * | | | * | * | * | * | 4
+---+---+---+---+---+---+---+
3 | * | * | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | * | * | 2
+---+---+---+
1 | * | * | * | 1
+---+---+---+
a b c d e f g
(e4->c4)
a b c d e f g
+---+---+---+
7 | * | * | * | 7
+---+---+---+
6 | * | * | * | 6
+---+---+---+---+---+---+---+
5 | * | * | | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | * | | * | | | * | * | 4
+---+---+---+---+---+---+---+
3 | * | * | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | * | * | 2
+---+---+---+
1 | * | * | * | 1
+---+---+---+
a b c d e f g
(c7->c5)
a b c d e f g
+---+---+---+
7 | | * | * | 7
+---+---+---+
6 | | * | * | 6
+---+---+---+---+---+---+---+
5 | * | * | * | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | * | | * | | | * | * | 4
+---+---+---+---+---+---+---+
3 | * | * | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | * | * | 2
+---+---+---+
1 | * | * | * | 1
+---+---+---+
a b c d e f g
(g4->e4)
a b c d e f g
+---+---+---+
7 | | * | * | 7
+---+---+---+
6 | | * | * | 6
+---+---+---+---+---+---+---+
5 | * | * | * | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | * | | * | | * | | | 4
+---+---+---+---+---+---+---+
3 | * | * | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | * | * | 2
+---+---+---+
1 | * | * | * | 1
+---+---+---+
a b c d e f g
(e2->c2)
a b c d e f g
+---+---+---+
7 | | * | * | 7
+---+---+---+
6 | | * | * | 6
+---+---+---+---+---+---+---+
5 | * | * | * | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | * | | * | | * | | | 4
+---+---+---+---+---+---+---+
3 | * | * | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | * | | | 2
+---+---+---+
1 | * | * | * | 1
+---+---+---+
a b c d e f g
(c4->c6)
a b c d e f g
+---+---+---+
7 | | * | * | 7
+---+---+---+
6 | * | * | * | 6
+---+---+---+---+---+---+---+
5 | * | * | | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | * | | | | * | | | 4
+---+---+---+---+---+---+---+
3 | * | * | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | * | | | 2
+---+---+---+
1 | * | * | * | 1
+---+---+---+
a b c d e f g
(e7->c7)
a b c d e f g
+---+---+---+
7 | * | | | 7
+---+---+---+
6 | * | * | * | 6
+---+---+---+---+---+---+---+
5 | * | * | | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | * | | | | * | | | 4
+---+---+---+---+---+---+---+
3 | * | * | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | * | | | 2
+---+---+---+
1 | * | * | * | 1
+---+---+---+
a b c d e f g
(e4->e2)
a b c d e f g
+---+---+---+
7 | * | | | 7
+---+---+---+
6 | * | * | * | 6
+---+---+---+---+---+---+---+
5 | * | * | | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | * | | | | | | | 4
+---+---+---+---+---+---+---+
3 | * | * | * | * | | * | * | 3
+---+---+---+---+---+---+---+
2 | * | | * | 2
+---+---+---+
1 | * | * | * | 1
+---+---+---+
a b c d e f g
(c2->c4)
a b c d e f g
+---+---+---+
7 | * | | | 7
+---+---+---+
6 | * | * | * | 6
+---+---+---+---+---+---+---+
5 | * | * | | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | * | | * | | | | | 4
+---+---+---+---+---+---+---+
3 | * | * | | * | | * | * | 3
+---+---+---+---+---+---+---+
2 | | | * | 2
+---+---+---+
1 | * | * | * | 1
+---+---+---+
a b c d e f g
(e1->e3)
a b c d e f g
+---+---+---+
7 | * | | | 7
+---+---+---+
6 | * | * | * | 6
+---+---+---+---+---+---+---+
5 | * | * | | * | * | * | * | 5
+---+---+---+---+---+---+---+
4 | * | | * | | | | | 4
+---+---+---+---+---+---+---+
3 | * | * | | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | | | 2
+---+---+---+
1 | * | * | | 1
+---+---+---+
a b c d e f g
(e5->c5)
a b c d e f g
+---+---+---+
7 | * | | | 7
+---+---+---+
6 | * | * | * | 6
+---+---+---+---+---+---+---+
5 | * | * | * | | | * | * | 5
+---+---+---+---+---+---+---+
4 | * | | * | | | | | 4
+---+---+---+---+---+---+---+
3 | * | * | | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | | | 2
+---+---+---+
1 | * | * | | 1
+---+---+---+
a b c d e f g
(g5->e5)
a b c d e f g
+---+---+---+
7 | * | | | 7
+---+---+---+
6 | * | * | * | 6
+---+---+---+---+---+---+---+
5 | * | * | * | | * | | | 5
+---+---+---+---+---+---+---+
4 | * | | * | | | | | 4
+---+---+---+---+---+---+---+
3 | * | * | | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | | | 2
+---+---+---+
1 | * | * | | 1
+---+---+---+
a b c d e f g
(b5->d5)
a b c d e f g
+---+---+---+
7 | * | | | 7
+---+---+---+
6 | * | * | * | 6
+---+---+---+---+---+---+---+
5 | * | | | * | * | | | 5
+---+---+---+---+---+---+---+
4 | * | | * | | | | | 4
+---+---+---+---+---+---+---+
3 | * | * | | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | | | 2
+---+---+---+
1 | * | * | | 1
+---+---+---+
a b c d e f g
(a3->c3)
a b c d e f g
+---+---+---+
7 | * | | | 7
+---+---+---+
6 | * | * | * | 6
+---+---+---+---+---+---+---+
5 | * | | | * | * | | | 5
+---+---+---+---+---+---+---+
4 | * | | * | | | | | 4
+---+---+---+---+---+---+---+
3 | | | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | | | 2
+---+---+---+
1 | * | * | | 1
+---+---+---+
a b c d e f g
(a5->a3)
a b c d e f g
+---+---+---+
7 | * | | | 7
+---+---+---+
6 | * | * | * | 6
+---+---+---+---+---+---+---+
5 | | | | * | * | | | 5
+---+---+---+---+---+---+---+
4 | | | * | | | | | 4
+---+---+---+---+---+---+---+
3 | * | | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | | | 2
+---+---+---+
1 | * | * | | 1
+---+---+---+
a b c d e f g
(c7->c5)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | * | * | 6
+---+---+---+---+---+---+---+
5 | | | * | * | * | | | 5
+---+---+---+---+---+---+---+
4 | | | * | | | | | 4
+---+---+---+---+---+---+---+
3 | * | | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | | | 2
+---+---+---+
1 | * | * | | 1
+---+---+---+
a b c d e f g
(d5->b5)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | * | * | 6
+---+---+---+---+---+---+---+
5 | | * | | | * | | | 5
+---+---+---+---+---+---+---+
4 | | | * | | | | | 4
+---+---+---+---+---+---+---+
3 | * | | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | | | 2
+---+---+---+
1 | * | * | | 1
+---+---+---+
a b c d e f g
(e6->e4)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | * | | 6
+---+---+---+---+---+---+---+
5 | | * | | | | | | 5
+---+---+---+---+---+---+---+
4 | | | * | | * | | | 4
+---+---+---+---+---+---+---+
3 | * | | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | | | 2
+---+---+---+
1 | * | * | | 1
+---+---+---+
a b c d e f g
(c1->e1)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | * | | 6
+---+---+---+---+---+---+---+
5 | | * | | | | | | 5
+---+---+---+---+---+---+---+
4 | | | * | | * | | | 4
+---+---+---+---+---+---+---+
3 | * | | * | * | * | * | * | 3
+---+---+---+---+---+---+---+
2 | | | | 2
+---+---+---+
1 | | | * | 1
+---+---+---+
a b c d e f g
(e4->e2)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | * | | 6
+---+---+---+---+---+---+---+
5 | | * | | | | | | 5
+---+---+---+---+---+---+---+
4 | | | * | | | | | 4
+---+---+---+---+---+---+---+
3 | * | | * | * | | * | * | 3
+---+---+---+---+---+---+---+
2 | | | * | 2
+---+---+---+
1 | | | * | 1
+---+---+---+
a b c d e f g
(g3->e3)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | * | | 6
+---+---+---+---+---+---+---+
5 | | * | | | | | | 5
+---+---+---+---+---+---+---+
4 | | | * | | | | | 4
+---+---+---+---+---+---+---+
3 | * | | * | * | * | | | 3
+---+---+---+---+---+---+---+
2 | | | * | 2
+---+---+---+
1 | | | * | 1
+---+---+---+
a b c d e f g
(d3->f3)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | * | | 6
+---+---+---+---+---+---+---+
5 | | * | | | | | | 5
+---+---+---+---+---+---+---+
4 | | | * | | | | | 4
+---+---+---+---+---+---+---+
3 | * | | * | | | * | | 3
+---+---+---+---+---+---+---+
2 | | | * | 2
+---+---+---+
1 | | | * | 1
+---+---+---+
a b c d e f g
(e1->e3)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | * | | 6
+---+---+---+---+---+---+---+
5 | | * | | | | | | 5
+---+---+---+---+---+---+---+
4 | | | * | | | | | 4
+---+---+---+---+---+---+---+
3 | * | | * | | * | * | | 3
+---+---+---+---+---+---+---+
2 | | | | 2
+---+---+---+
1 | | | | 1
+---+---+---+
a b c d e f g
(f3->d3)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | * | | 6
+---+---+---+---+---+---+---+
5 | | * | | | | | | 5
+---+---+---+---+---+---+---+
4 | | | * | | | | | 4
+---+---+---+---+---+---+---+
3 | * | | * | * | | | | 3
+---+---+---+---+---+---+---+
2 | | | | 2
+---+---+---+
1 | | | | 1
+---+---+---+
a b c d e f g
(d3->b3)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | * | | 6
+---+---+---+---+---+---+---+
5 | | * | | | | | | 5
+---+---+---+---+---+---+---+
4 | | | * | | | | | 4
+---+---+---+---+---+---+---+
3 | * | * | | | | | | 3
+---+---+---+---+---+---+---+
2 | | | | 2
+---+---+---+
1 | | | | 1
+---+---+---+
a b c d e f g
(a3->c3)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | * | | 6
+---+---+---+---+---+---+---+
5 | | * | | | | | | 5
+---+---+---+---+---+---+---+
4 | | | * | | | | | 4
+---+---+---+---+---+---+---+
3 | | | * | | | | | 3
+---+---+---+---+---+---+---+
2 | | | | 2
+---+---+---+
1 | | | | 1
+---+---+---+
a b c d e f g
(c3->c5)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | * | | 6
+---+---+---+---+---+---+---+
5 | | * | * | | | | | 5
+---+---+---+---+---+---+---+
4 | | | | | | | | 4
+---+---+---+---+---+---+---+
3 | | | | | | | | 3
+---+---+---+---+---+---+---+
2 | | | | 2
+---+---+---+
1 | | | | 1
+---+---+---+
a b c d e f g
(b5->d5)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | * | | 6
+---+---+---+---+---+---+---+
5 | | | | * | | | | 5
+---+---+---+---+---+---+---+
4 | | | | | | | | 4
+---+---+---+---+---+---+---+
3 | | | | | | | | 3
+---+---+---+---+---+---+---+
2 | | | | 2
+---+---+---+
1 | | | | 1
+---+---+---+
a b c d e f g
(d6->d4)
a b c d e f g
+---+---+---+
7 | | | | 7
+---+---+---+
6 | | | | 6
+---+---+---+---+---+---+---+
5 | | | | | | | | 5
+---+---+---+---+---+---+---+
4 | | | | * | | | | 4
+---+---+---+---+---+---+---+
3 | | | | | | | | 3
+---+---+---+---+---+---+---+
2 | | | | 2
+---+---+---+
1 | | | | 1
+---+---+---+
a b c d e f g