'A8-W','B8-B','C8-W','D8-B','E8-W','F8-B','G8-W','H8-B'
'A7-B','B7-W','C7-B','D7-W','E7-B','F7-W','G7-B','H7-W'
'A6-W','B6-B','C6-W','D6-B','E6-W','F6-B','G6-W','H6-B'
'A5-B','B5-W','C5-B','D5-W','E5-B','F5-W','G5-B','H5-W'
'A4-W','B4-B','C4-W','D4-B','E4-W','F4-B','G4-W','H4-B'
'A3-B','B3-W','C3-B','D3-W','E3-B','F3-W','G3-B','H3-W'
'A2-W','B2-B','C2-W','D2-B','E2-W','F2-B','G2-W','H2-B'
'A1-B','B1-W','C1-B','D1-W','E1-B','F1-W','G1-B','H1-W'
8=A8wB8bC8wD8bE8wF8bG8wH8b
7=A7bB7wC7bD7wE7bF7wG7bH7w
6=A6wB6bC6wD6bE6wF6bG6wH6b
5=A5bB5wC5bD5wE5bF5wG5bH5w
4=A4wB4bC4wD4bE4wF4bG4wH4b
3=A3bB3wC3bD3wE3bF3wG3bH3w
2=A2wB2bC2wD2bE2wF2bG2wH2b
1=A1bB1wC1bD1wE1bF1wG1bH1w
King = (k) 100% - ∞ points
Queen =(q) 100% - 9 points
Rook =(r) 100% - 5 points
Bishop =(b) 100% - 3 points
Knight =(n) 100% - 3 points
Pawn =(p) 100% - 1 points
It is now time to set up the board.
8=(r)A8w(n)B8b(h)C8w(q)D8b(k)E8w(b)F8b(n)G8w(r)H8b
7=(p)A7b(p)B7w(p)C7b(p)D7w(p)E7b(p)F7w(p)G7b(p)H7w
6=A6wB6bC6wD6bE6wF6bG6wH6b
5=A5bB5wC5bD5wE5bF5wG5bH5w
4=*A4w*B4b*C4w*D4b*E4w*F4b*G4w*H4b
3=*A3b*B3w*C3b*D3w*E3b*F3w*G3b*H3w
2=(p)A2w(p)B2b(p)C2w(p)D2b(p)E2w(p)F2b(p)G2w(p)H2b
1=(r)A1b(n)B1w(b)C1b(q)D1w(k)E1b(b)F1w(n)G1b(r)H1w
We won't mess with the board state. As the code we created earlier relies on it. If you were to add the data, such as each piece.
We would have to change the original code entirely.
Here is what would mainly need to change:
ECHO.programs.chess.render(temp[0],temp[1],temp[3]);
This is the original renderer.
ECHO.programs.chess.render(x, y, color);
We could update this to something like:
ECHO.programs.chess.render(x, y, color, piece);
Then update the board from this:
ECHO.programs.chess.board =["A8-W"];
To something like this:
ECHO.programs.chess.board =["A8-Wr"]; //this is just an example
But we would need to update:
board=ECHO.programs.chess.board;
temp =board[i].split("", 5);
ECHO.programs.chess.render(temp[0], temp[1], temp[3], temp[4]);
This will for example make our board renderer look like:
Unauthorized duplication: this narrative has been taken without consent. Report sightings.
ECHO.programs.chess.render(A, 8, W, r);
This is your 'system' anyways. You would then just need to make a few changes to have the board for ECHO update.
You don't need to make your code match the examples in this technique. Remember this, all of the logic is functioning however you want.
So, as long as your 'code' makes sense to you. You can get away with doing things that wouldn't necessarily work in an actual programming language.
----------------------------------------
Now... you want to program a separate log. This will be for notation.
You already have a lot of data generated in your console. Most of it is not necessary at all. So, now you will be 'pruning' a lot of this information and making chess less complicated.
Basically, you will convert the moves from being rendered into just text. Just like how you update your text passwords in conjunction with your board state.
White | Black
1) 1)
2) 2)
3) 3)
4) 4)
5) 5)
6) 6)
7) 7)
8) 8)
9) 9)
10) 10)
8=(r)A8w(n)B8b(h)C8w(q)D8b(k)E8w(b)F8b(n)G8w(r)H8b
7=(p)A7b(p)B7w(p)C7b(p)D7w(p)E7b(p)F7w(p)G7b(p)H7w
6=A6wB6bC6wD6bE6wF6bG6wH6b
5=A5bB5wC5bD5wE5bF5wG5bH5w
4=*A4w*B4b*C4w*D4b*E4w*F4b*G4w*H4b
3=*A3b*B3w*C3b*D3w*E3b*F3w*G3b*H3w
2=(p)A2w(p)B2b(p)C2w(p)D2b(p)E2w(p)F2b(p)G2w(p)H2b
1=(r)A1b(n)B1w(b)C1b(q)D1w(k)E1b(b)F1w(n)G1b(r)H1w
So let's say you move the pawn from e2 to e4.
Your log will look like this:
1.e4
The pawn doesn't need to have a letter designating that it is the pawn.
Let's then say you want to move the king.
Since it is the second move. Say, you move it from e1 to e2.
1.e4
2.Ke2
This is just for moving a piece normally. What about captures? Castling? Or check/checkmate?
Let's say you have a pawn on e4, while black has a pawn on f5.
The log looks like:
1.e4 1.f5
You then capture the piece on f5.
1.e4 1.f5
2.exf5 2.
Let's actually play out part of the game here.
Move the black knight from g8 to h6.
1.e4 1.f5
2.exf5 2.Nh6
Then... move the the pawn from d2 to d4.
1.e4 1.f5
2.exf5 2.Nh6
3.d4 3.
Then e7 to e6.
1.e4 1.f5
2.exf5 2.Nh6
3.d4 3.e6
Then move g2 to g3.
1.e4 1.f5
2.exf5 2.Nh6
3.d4 3.e6
4.g3 4.
Now move the black bishop from f8 to c5.
1.e4 1.f5
2.exf5 2.Nh6
3.d4 3.e6
4.g3 4.Bc5
Now move the knight from b1 to c3
1.e4 1.f5
2.exf5 2.Nh6
3.d4 3.e6
4.g3 4.Bc5
5.Nc3 5.
Now... I'll give you an example of doing a castle.
1.e4 1.f5
2.exf5 2.Nh6
3.d4 3.e6
4.g3 4.Bc5
5.Nc3 5.0-0
If you castle from the king's side. In your log, you will put 0-0.
If you castle from the queen's side. In your log, you will put 0-0-0.
Now, let me show you what happens when you capture a piece.
The white pawn on f5. You move it to capture the black pawn on e6.
1.e4 1.f5
2.exf5 2.Nh6
3.d4 3.e6
4.g3 4.Bc5
5.Nc3 5.0-0
6.fxe6 6.
Let's play a bit more and see what check/checkmate looks like.
Black bishop on c5 attacks pawn on d4.
1.e4 1.f5
2.exf5 2.Nh6
3.d4 3.e6
4.g3 4.Bc5
5.Nc3 5.0-0
6.fxe6 6.Bxd4
Move knight from c3 to e2
1.e4 1.f5
2.exf5 2.Nh6
3.d4 3.e6
4.g3 4.Bc5
5.Nc3 5.0-0
6.fxe6 6.Bxd4
7.Nce2 7.
Now, we can see what check looks like.
1.e4 1.f5
2.exf5 2.Nh6
3.d4 3.e6
4.g3 4.Bc5
5.Nc3 5.0-0
6.fxe6 6.Bxd4
7.Nce2 7.Bfx2+
The king is trapped here and is forced to move to d2
1.e4 1.f5
2.exf5 2.Nh6
3.d4 3.e6
4.g3 4.Bc5
5.Nc3 5.0-0
6.fxe6 6.Bxd4
7.Nce2 7.Bfx2+
8.Kd2 8.
If it is checkmate. Instead of a '+'. You do '#' at the end.
Now, there are some weird situations where you have to further detail the notation.
If both pieces are of the same type and can move to the same square. Just add the original position to the log. But this is pretty rare.
Your visual simulation limit has been increased from this 'exercise'.