Skip to content

Commit

Permalink
Add more chess games and sort by round
Browse files Browse the repository at this point in the history
  • Loading branch information
bdmendes committed Jan 26, 2025
1 parent f27b1b3 commit 4dc5c62
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
11 changes: 11 additions & 0 deletions content/chess/2019/2019-04-13-joao-cordeiro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
white: João Cordeiro
whiteElo: 1894
blackElo: 1423
result: 1-0
round: 1
board: 3
tournament: CN Jovens S18 2019
---

1. e4 e6 2. d4 d5 3. Nd2 c5 4. c3 Nc6 5. dxc5 Bxc5 6. Nb3 Be7 (6... Bb6) 7. exd5 exd5 8. Nf3 Nf6 9. Be2 O-O 10. h3 Re8 11. Be3 b6?! (11... Bf5 { [%csl Rb7][%cal Rd1b3] }) 12. Bb5 Bb7 13. Nbd4 Rc8 14. Qa4 Qc7 15. O-O Bc5 16. b4 Bxd4 17. Nxd4 Nxd4 18. Bxd4 Re4? (18... Re6 19. Rfe1 Ne4 { [%csl Gc3] }) 19. Bd3 Rh4 20. Bf5? (20. Qxa7 $16) 20... Bc6 21. Qb3 Bd7 22. Bxf6 Bxf5?? 23. Bxh4 Qxc3 24. Qxc3 *
11 changes: 11 additions & 0 deletions content/chess/2019/2019-04-14-jose-soares.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
whiteElo: 0
white: José Soares
blackElo: 1423
tournament: CN Jovens S18 2019
result: 0-1
board: 10
round: 3
---

1. e4 e6 2. d4 d5 3. exd5 exd5 4. Bd3 Bd6 5. Nf3 Ne7 6. O-O Bg4 7. h3 Bh5 8. a3?! Nbc6 9. Be3 O-O?! (9... h6) 10. Bxh7+!? Kxh7 11. Ng5+ Kg6 12. Qd3+? (12. g4! Rh8 13. gxh5+ Rxh5 14. Ne6! $16 { [%csl Gg5,Ge3][%cal Gd1g4] }) 12... Kf6 13. Nh7+ Ke6 14. Nxf8+ Qxf8 $44 $32 { [%cal Gh5g6] } 15. Nc3 Bg6 16. Qe2 Kd7 17. Qb5?! a6 18. Qxb7?? Na5 19. Qxa8 Qxa8 20. b4 Nc4 21. Bg5 Qc6 22. Ra2 f6 23. Bc1 Nxa3 24. Bxa3 Qxc3 *
11 changes: 11 additions & 0 deletions content/chess/2019/2019-04-14-luis-lanca.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
black: Luís Lança
whiteElo: 1423
blackElo: 1211
round: 2
board: 10
tournament: CN Jovens S18 2019
result: 1-0
---

1. d4 d5 2. Bf4 Bf5 3. e3 Nf6 4. Nd2 e6 5. Ngf3 Be7 6. Bd3?! (6. Ne5 Nc6 7. Bb5) 6... Bg6 7. Ne5 Nbd7 8. Nxg6 hxg6 9. h3?! (9. O-O Nh5 10. Be5 Nxe5 11. dxe5 { [%cal Gg2g4] }) 9... Nb6 10. Qf3 Bd6 11. Bg5 Qe7 12. O-O-O (12. e4 dxe4 13. Nxe4 { [%csl Gf6] }) 12... Na4?? 13. Bb5+ c6 14. Bxa4 b5 15. Bb3 a5 16. a4 bxa4 17. Bxa4 Rc8 18. e4 O-O 19. e5 Ba3 20. Qxa3 Qxa3 21. bxa3 Nh7 22. Nf3 Rc7 23. Rd3 c5 24. dxc5 Rxc5?? 25. Be7 Rc4 26. Bb5 Rcc8 27. Bxf8 Kxf8 28. a4 f6 29. Re1 Kf7 30. Nd4 Ng5 31. exf6 gxf6 32. Nxe6 Nxe6 33. Bd7 Rc4 34. Bxe6+ Kg7 35. Bd7 Rf4 36. f3 Rf5 37. Bxf5 *
11 changes: 9 additions & 2 deletions src/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,15 @@ export function createSlug(title: string) {
.replace(/^-+|-+$/g, '')
}

export function sortedByDate<C extends { id: string }>(entry: C[]): C[] {
return entry.sort((a, b) => extractDate(b.id).valueOf() - extractDate(a.id).valueOf());
export function sortedByDate<C extends { id: string, data: any }>(entry: C[]): C[] {
return entry.sort((a, b) => {
const dateDiff = extractDate(b.id).valueOf() - extractDate(a.id).valueOf();
if (dateDiff != 0) {
return dateDiff;
}
const roundDiff = b.data.round - a.data.round;
return roundDiff != null ? roundDiff : 0;
});
}

export function buildChessMetaTags(round?: number, board?: number) {
Expand Down

0 comments on commit 4dc5c62

Please sign in to comment.