From 42661d37ad2812d4184708b353a71e9cc4cf5d08 Mon Sep 17 00:00:00 2001 From: Paula Date: Sun, 11 Oct 2026 15:54:58 -0300 Subject: [PATCH] Chess minigame --- docs/modding/resources/loot_tables.md | 16 +- mods/bworld/CREDITS.md | 8 + mods/bworld/items/cod.json | 4 +- mods/bworld/scripts/minigames/chess.ts | 374 ++++++++++++++++++++++ mods/bworld/scripts/minigames/maze.ts | 25 +- mods/bworld/scripts/minigames/minigame.ts | 27 ++ mods/bworld/scripts/minigames/mod.ts | 2 + mods/bworld/textures/bishop.png | Bin 0 -> 214 bytes mods/bworld/textures/black_bishop.png | Bin 0 -> 211 bytes mods/bworld/textures/black_king.png | Bin 0 -> 207 bytes mods/bworld/textures/black_knight.png | Bin 0 -> 198 bytes mods/bworld/textures/black_pawn.png | Bin 0 -> 160 bytes mods/bworld/textures/black_queen.png | Bin 0 -> 191 bytes mods/bworld/textures/black_rook.png | Bin 0 -> 187 bytes mods/bworld/textures/king.png | Bin 0 -> 202 bytes mods/bworld/textures/knight.png | Bin 0 -> 210 bytes mods/bworld/textures/pawn.png | Bin 0 -> 170 bytes mods/bworld/textures/queen.png | Bin 0 -> 203 bytes mods/bworld/textures/rook.png | Bin 0 -> 201 bytes tests/fishing_test.ts | 25 ++ 20 files changed, 453 insertions(+), 28 deletions(-) create mode 100644 mods/bworld/scripts/minigames/chess.ts create mode 100644 mods/bworld/textures/bishop.png create mode 100644 mods/bworld/textures/black_bishop.png create mode 100644 mods/bworld/textures/black_king.png create mode 100644 mods/bworld/textures/black_knight.png create mode 100644 mods/bworld/textures/black_pawn.png create mode 100644 mods/bworld/textures/black_queen.png create mode 100644 mods/bworld/textures/black_rook.png create mode 100644 mods/bworld/textures/king.png create mode 100644 mods/bworld/textures/knight.png create mode 100644 mods/bworld/textures/pawn.png create mode 100644 mods/bworld/textures/queen.png create mode 100644 mods/bworld/textures/rook.png diff --git a/docs/modding/resources/loot_tables.md b/docs/modding/resources/loot_tables.md index fa71ebc..cf08619 100644 --- a/docs/modding/resources/loot_tables.md +++ b/docs/modding/resources/loot_tables.md @@ -147,14 +147,14 @@ The fishing table, `bworld:gameplay/fishing`, isn't a file: the base game builds } ``` -| Field | What | -| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `weight` | How often it's caught against the other fish, 1 when not given. | -| `seasons` | The [seasons](../worldgen/biomes.md#seasons) it's caught in where the hook is, every one when not given. | -| `biomes` | The [biomes](../worldgen/biomes.md#biome-ids) and [biome tags](../worldgen/biomes.md#biome-tags) it's caught in where the hook is, every one when not given. | -| `time` | The hours it's caught at on a 24 hour clock, from `from` up to `to`, like `6.5` for 06:30. When `from` is past `to` it wraps around midnight. All day when not given. | -| `minigame` | What the player does to land it once it's reeled in, in a screen that holds the fish until they win. Closing it lets the fish get away. Caught right away when not given. The base game's are `"test"`, a Catch button, `"hold"`, a bar that fills while the mouse is held and empties while it isn't: full lands the fish, empty loses it, `"valley"`, Stardew Valley's, where holding the mouse lifts a bar to keep the fish in it, `"ring"`, where a green ring grows out toward gray ones and clicking while it's inside each lands the fish, and `"maze"`, where the mouse goes from the start to the end of a maze without touching its walls, in 8 seconds. | -| `difficulty` | How hard its minigame is, 10 when not given. In `"hold"`, the bar empties `1 + difficulty / 100` times as fast as it fills: 1.1 at 10, 2 at 100. In `"ring"`, the green ring grows `1 + difficulty / 100` times as fast, and there's a gray ring to click for every 30 difficulty: 1 up to 30, 2 up to 60, 3 up to 90, 4 up to 120. In `"maze"`, the maze is 4 cells a side and 1 more for every 25 difficulty. In `"valley"`, it's Stardew Valley's fish difficulty: the higher, the more the fish darts around. | +| Field | What | +| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `weight` | How often it's caught against the other fish, 1 when not given. | +| `seasons` | The [seasons](../worldgen/biomes.md#seasons) it's caught in where the hook is, every one when not given. | +| `biomes` | The [biomes](../worldgen/biomes.md#biome-ids) and [biome tags](../worldgen/biomes.md#biome-tags) it's caught in where the hook is, every one when not given. | +| `time` | The hours it's caught at on a 24 hour clock, from `from` up to `to`, like `6.5` for 06:30. When `from` is past `to` it wraps around midnight. All day when not given. | +| `minigame` | What the player does to land it once it's reeled in, in a screen that holds the fish until they win. Closing it lets the fish get away. Caught right away when not given. The base game's are `"test"`, a Catch button, `"hold"`, a bar that fills while the mouse is held and empties while it isn't: full lands the fish, empty loses it, `"valley"`, Stardew Valley's, where holding the mouse lifts a bar to keep the fish in it, `"ring"`, where a green ring grows out toward gray ones and clicking while it's inside each lands the fish, `"maze"`, where the mouse goes from the start to the end of a maze without touching its walls, in 8 seconds, and `"chess"`, a mate in one from Lichess's puzzles to find in 8 seconds. | +| `difficulty` | How hard its minigame is, 10 when not given. In `"hold"`, the bar empties `1 + difficulty / 100` times as fast as it fills: 1.1 at 10, 2 at 100. In `"ring"`, the green ring grows `1 + difficulty / 100` times as fast, and there's a gray ring to click for every 30 difficulty: 1 up to 30, 2 up to 60, 3 up to 90, 4 up to 120. In `"maze"`, the maze is 4 cells a side and 1 more for every 25 difficulty. In `"valley"`, it's Stardew Valley's fish difficulty: the higher, the more the fish darts around. | When every fish can be ruled out, nothing is caught, so keep one that's always caught. diff --git a/mods/bworld/CREDITS.md b/mods/bworld/CREDITS.md index f53d137..c656e01 100644 --- a/mods/bworld/CREDITS.md +++ b/mods/bworld/CREDITS.md @@ -2174,3 +2174,11 @@ https://freesound.org/people/youandbiscuitme/sounds/258246/ - x_farming_chicken_nest_with_chicken.mtl - x_farming_pie.mtl ``` + +# Pixel Chess + +Credits Ajay Karat | Devil's Work.shop http://devilswork.shop/ + +https://devilsworkshop.itch.io/pixel-art-chess-asset-pack + +license: CC0 1.0 Universal (CC0 1.0) diff --git a/mods/bworld/items/cod.json b/mods/bworld/items/cod.json index 07ab895..af9e467 100644 --- a/mods/bworld/items/cod.json +++ b/mods/bworld/items/cod.json @@ -12,8 +12,8 @@ "weight": 25, "seasons": ["spring", "summer", "autumn", "winter"], "biomes": ["#bworld:is_ocean"], - "minigame": "maze", - "difficulty": 100 + "minigame": "chess", + "difficulty": 0 } }, "base_sell_value": 30 diff --git a/mods/bworld/scripts/minigames/chess.ts b/mods/bworld/scripts/minigames/chess.ts new file mode 100644 index 0000000..9d27842 --- /dev/null +++ b/mods/bworld/scripts/minigames/chess.ts @@ -0,0 +1,374 @@ +// a lichess mate in one: the board after the opponent's move, and the player has SOLVE_TIME to play the mate. it's +// all played on the screen, which says how it went: button 1 for the mate, 0 for any other move +import type { Color, Graphics } from "bworld/client"; +import { FishingMinigame, type MinigameArgs, type MinigameScreen, SOLVE_TIME, time_bar } from "./minigame.ts"; + +export class ChessMinigame extends FishingMinigame { + constructor(...args: MinigameArgs) { + super(...args); + this.listen_for_result(); + this.time_limit(SOLVE_TIME); + } +} + +// a random puzzle's board, whose move it is above it and the time left under it. clicking one of the player's pieces +// picks it up, and clicking where it goes plays the move. only lichess's answer counts as the mate +export const chess_screen: MinigameScreen = (menu) => { + const [, fen, moves] = mate_in_one[Math.floor(Math.random() * mate_in_one.length)].split(","); + const [opponent_move, mate] = moves.split(" "); + const board = parse_fen(fen); + play(board, opponent_move); + const white = fen.split(" ")[1] === "b"; + const width = 8 * SQUARE; + const top = 12; + let picked: string | undefined; + let over = false; + // the square under x, y, like "e4", with the player's side at the bottom + const square_at = (x: number, y: number) => { + const file = Math.floor(x / SQUARE); + const row = Math.floor((y - top) / SQUARE); + if (file < 0 || file > 7 || row < 0 || row > 7) return undefined; + return white ? "abcdefgh"[file] + (8 - row) : "abcdefgh"[7 - file] + (row + 1); + }; + return { + width, + height: top + width + 6, + dim_background: false, + inventory_overlays: false, + on_render_labels(g) { + const text = `${white ? "White" : "Black"} to mate in 1`; + g.text(text, (width - g.measure_text(text)) / 2, 0); + for (let row = 0; row < 8; row++) { + for (let file = 0; file < 8; file++) { + const square = square_at(file * SQUARE, top + row * SQUARE)!; + const [x, y] = [file * SQUARE, top + row * SQUARE]; + const light = (row + file) % 2 === 0; + const color: Color = square === picked + ? [0.8, 0.8, 0.3, 1] + : light + ? [0.93, 0.85, 0.7, 1] + : [0.7, 0.53, 0.39, 1]; + g.rect(x, y, SQUARE, SQUARE, color); + const piece = board.get(square); + if (piece) draw_piece(g, piece, x, y); + } + } + time_bar(g, menu, 0, top + width + 2, width, 4); + + if (over || !g.mouse.pressed) return; + const square = square_at(g.mouse.x, g.mouse.y); + const piece = square && board.get(square); + if (!square) return; + if (piece && (piece === piece.toUpperCase()) === white) { + picked = square; + } else if (picked) { + over = true; + menu.click_button(picked + square === mate.slice(0, 4) ? 1 : 0); + } + }, + }; +}; + +// in gui pixels +const SQUARE = 16; + +// a piece by its fen letter: white's are textures/.png, black's the same inverted, textures/black_.png +const PIECES: Record = { k: "king", q: "queen", r: "rook", b: "bishop", n: "knight", p: "pawn" }; +function draw_piece(g: Graphics, piece: string, x: number, y: number) { + const name = PIECES[piece.toLowerCase()]; + g.texture(piece === piece.toUpperCase() ? `bworld:${name}` : `bworld:black_${name}`, x, y, SQUARE, SQUARE); +} + +// a fen's pieces by square, like "e1" to "K" +function parse_fen(fen: string): Map { + const board = new Map(); + fen.split(" ")[0].split("/").forEach((rank, row) => { + let file = 0; + for (const char of rank) { + if (/[1-8]/.test(char)) { + file += Number(char); + } else { + board.set("abcdefgh"[file] + (8 - row), char); + file++; + } + } + }); + return board; +} + +// plays a uci move like "e2e4" or "a2a1q" on the board, with castling's rook and en passant's captured pawn +function play(board: Map, move: string) { + const [from, to, promotion] = [move.slice(0, 2), move.slice(2, 4), move[4]]; + const piece = board.get(from)!; + const pawn = piece.toUpperCase() === "P"; + if (pawn && from[0] !== to[0] && !board.has(to)) board.delete(to[0] + from[1]); + if (piece.toUpperCase() === "K" && Math.abs(from.charCodeAt(0) - to.charCodeAt(0)) === 2) { + const [rook_from, rook_to] = to[0] === "g" ? ["h", "f"] : ["a", "d"]; + board.set(rook_to + to[1], board.get(rook_from + to[1])!); + board.delete(rook_from + to[1]); + } + board.delete(from); + board.set(to, promotion ? (piece === piece.toUpperCase() ? promotion.toUpperCase() : promotion) : piece); +} + +// https://github.com/samboy/ChessLua/blob/main/mateInOne.csv +// from the lichess puzzle database: PuzzleId,FEN,Moves,Rating. the fen is before the opponent's move, the first of +// Moves, and the second is the mate +const mate_in_one = [ + "000095aa,5rk1/p1q2pp1/3r1B1p/1pb2Q2/2p2P2/5P1P/PPB3K1/R3R3 b - - 0 23,d6f6 f5h7,789", + "0000de0f,3Q3k/6p1/1pn1K2p/7r/8/8/P7/1B1R4 b - - 0 51,c6d8 d1d8,1080", + "00010d3c,rn1q1rk1/2ppb1pp/p3p3/4B3/3P4/2P5/PP3PQP/R3K2R b KQ - 0 16,b8c6 g2g7,934", + "00010d82,4R1rk/5Qpp/p4p2/1p6/8/1P5P/Pqr2PP1/6K1 b - - 3 35,c2c8 f7g8,1109", + "000133fe,r1bq2kr/pppp2pp/2n5/2bQp1N1/8/2P5/PPP2PPP/R1B2RK1 b - - 3 9,g8f8 d5f7,1218", + "0001c95a,r2q1rk1/1bp2pp1/pb1p3p/np2P3/3P2nN/P2Q4/1PB2PPP/RNB1R1K1 b - - 0 15,g4f2 d3h7,1214", + "0001e186,3rk3/p2Q1pp1/1p6/1B1P1N1b/3P2n1/4P3/PP3P2/2R1K1Nq b - - 0 21,d8d7 c1c8,1452", + "0001fce4,8/8/1k4R1/p1p5/1p1r4/PK6/1P6/8 b - - 3 41,b6b5 a3a4,1275", + "00021e04,5r1k/p6p/Pp3q1p/1P3p2/2Q1pP2/6RP/6PK/8 b - - 1 49,f8g8 c4g8,809", + "00028486,4rQ1k/pp4pp/2p5/8/4q2N/7P/PP1r2P1/R4R1K b - - 2 28,e8f8 f1f8,707", + "0003490b,1r2Q1k1/1ppR2pr/p1q4p/8/8/8/P4PPP/4R1K1 b - - 3 27,b8e8 e1e8,709", + "0003734e,r1b2k2/p1r2ppQ/1nN1pq1p/8/3P4/6P1/PP2PP1P/2R2RK1 b - - 0 19,c8b7 h7h8,821", + "00039746,3BQ1k1/pp3ppp/8/3p3b/8/3BrP2/Pq4PP/R3R2K b - - 2 21,e3e8 e1e8,929", + "0005f19f,r4kr1/pp4p1/2p2n1B/8/3q2Q1/2N5/PPP3PP/4RR1K b - - 0 23,d4g4 f1f6,1452", + "00061d76,1r1rbnk1/5p2/1q2pQ1P/p1bpP3/P5P1/1pP2N2/4NP2/1R3RK1 b - - 0 28,f8h7 f6g7,1093", + "0007d775,Q6R/2pk2q1/p2rn3/1p6/8/P2P4/1PP5/1K6 b - - 2 32,e6d4 a8e8,1601", + "00086438,R7/1qr5/k6p/P7/2pQ4/6P1/2P2P1P/6K1 b - - 8 38,b7a8 d4b6,1365", + "00087550,6k1/p5pp/8/3Q4/8/1P5P/q5PK/8 b - - 0 31,g8h8 d5d8,600", + "0008e40a,r4q1k/ppp5/3p2Qp/6p1/2Bbp1b1/4n3/PPPN2PP/R1B4K b - - 3 20,f8f2 g6h6,1593", + "0009a91f,5r1k/r4B1p/3q1Bp1/p3p3/1p2P3/3P1Q2/P1P3PP/5R1K b - - 4 28,d6f6 f3f6,713", + "000a8912,r4rk1/ppp2ppp/2n1q3/6Nb/8/3QP2P/PPP1B1P1/R4RK1 b - - 3 15,h5e2 d3h7,1178", + "000afe44,r2qr1Qk/4n1pp/p6N/1pn5/3P4/8/5PPP/R1R3K1 b - - 5 25,e7g8 h6f7,1153", + "000afeaa,r1b1k1nr/5pb1/pnq1p1pp/1pp3P1/4PB1P/2N2P1N/PPPQ2B1/3RK2R b Kkq - 3 14,b6c4 d2d8,924", + "000bce19,3r1nk1/4qp2/2p3pQ/2R1p3/2P1P1NP/1p1r2PB/5P2/4R1K1 b - - 0 39,e7c5 g4f6,887", + "000be397,1r1r3k/p5bp/8/4np1R/2q5/2N1PP2/P1QB1K2/R7 b - - 5 28,f5f4 c2h7,953", + "000be46a,3kR3/p2n1rp1/7p/1P1p4/3P1q2/Q7/PP3PPP/2R3K1 b - - 5 26,d8e8 c1c8,1324", + "000c564d,r3kb1r/pp3ppp/8/2P1pbB1/2B5/4P3/3K1PPP/1R4NR b kq - 0 14,f5b1 c4b5,1081", + "000cd085,5rk1/4R2p/p4npQ/3p4/2pP1Pq1/2P3P1/6KP/8 b - - 2 31,g4h5 h6g7,1102", + "000d8a8f,6Qk/4P1pp/2p2p2/p2p4/P2qb2P/4R3/6P1/4R1K1 b - - 0 39,h8g8 e7e8q,820", + "000d968e,6k1/3p1p1p/p5p1/1p6/3B4/1bP4q/1P1K1P1P/R3R3 b - - 1 29,h3h2 e1e8,600", + "000e280c,r4r1k/1Q4pp/3p4/4p3/4Pq2/8/P5R1/6K1 b - - 3 39,a8b8 b7g7,874", + "000e5672,4rrk1/6bp/3q1NpQ/p7/1pBp2P1/2P5/PP3PK1/4R3 b - - 0 31,g8h8 h6h7,1158", + "000f27e1,8/8/3R3R/5p1p/4k1p1/1r4P1/1r3PKP/8 b - - 7 39,b3f3 h6e6,1224", + "000f85df,5rnk/pbp2P1p/1p3Bp1/8/7P/2Pq4/PP1NrQP1/R4RK1 b - - 2 23,g8f6 f2f6,817", + "00109805,7k/N5pp/1p6/2p5/4N3/3p3P/1r2r1P1/5R1K b - - 3 40,e2g2 f1f8,664", + "00112b62,r4rk1/1p5p/p3b2q/7B/1P3p2/2QP2p1/PB4K1/R7 b - - 3 25,a8c8 c3h8,1469", + "001202cf,r5rk/pppq1ppn/3p1b1N/3P4/6QP/8/PPPB1PP1/2KRR3 b - - 0 18,d7g4 h6f7,1095", + "00125334,r4rk1/ppqnb2p/2p1p1B1/3p4/3P4/2P1P1P1/PPQ2PP1/R3K2R b KQ - 0 18,h7g6 c2g6,790", + "0012c1bc,3r2k1/6p1/5b2/p1pBpPpQ/q1P5/7P/P4R1K/8 b - - 3 30,g8f8 h5f7,1287", + "0013126c,r1b3k1/5ppp/3R4/pp1P4/8/1B6/Pr3PPP/3R2K1 b - - 0 29,a5a4 d6d8,600", + "00132a32,4r2Q/2p1kp2/4p1p1/5r2/1pq2P2/3R4/6PP/3R3K b - - 9 41,c4f4 d3d7,1066", + "001330de,r1qb1k2/pb1p2pp/np1P2N1/2p5/2B2r2/2P5/P3QPPP/R3R1K1 b - - 3 20,h7g6 e2e8,622", + "001388b2,7R/5p2/4rrk1/2B1p1p1/p3Q3/7P/5PPK/3q4 b - - 3 39,g6g7 e4h7,1383", + "001399e1,r4r1k/1R4p1/2p3Qp/p3Pp1P/3Pp3/4q3/4b1PK/7R b - - 1 29,e3d4 g6g7,1050", + "0013fc89,4r2k/3n1p1n/3p1B2/2p1pP1N/b1PqP1Q1/3P3P/6BK/5R2 b - - 2 28,h7f6 g4g7,1022", + "001408cd,8/p7/1p1k1R2/3P4/4Pp2/2K5/r7/8 b - - 0 36,d6e5 f6e6,1301", + "0014136b,6k1/2P2p1p/2r2P1p/p1pR4/6PP/2PP4/8/r4BK1 b - - 2 30,c6c7 d5d8,795", + "00146b77,r3r1k1/p3qpRp/7B/8/3pQ3/5P2/5P1P/7K b - - 0 24,g8f8 g7g5,1858", + "0014e68d,5nk1/p6p/1p1p1QpB/q7/3P4/2P5/P5PP/6K1 b - - 3 27,a5f5 f6g7,1119", + "00150654,r1bq1rk1/3n2p1/p1n1pp1p/1p1pP3/1P1P4/B1PQ4/P1BN2PP/R4R1K b - - 1 17,f6e5 d3h7,997", + "00150f79,5b1k/1pp1q1pp/p2p4/5Q2/5P2/2P1BP2/PP4K1/8 b - - 2 38,e7e3 f5f8,600", + "00151d6a,r3N1kr/pp3p1p/2q2QnB/3p4/8/8/PP4PP/4R2K b - - 3 22,c6f6 e8f6,1257", + "0015c78d,2k5/pp3Npp/4pn2/8/5P2/2P5/PPKQ2PP/6q1 b - - 4 24,g1h2 d2d8,753", + "00161d90,rq1k1b1r/1p3p1p/3p1Np1/1Qn5/4P3/8/PPP2PPP/R4RK1 b - - 0 15,b8c7 b5e8,1325", + "0016247b,6k1/p1Bq1ppp/1pp5/3b4/P7/3B4/2P2PPP/4Q1K1 b - - 0 22,d7c7 e1e8,818", + "0017076c,4rk2/p5p1/1p1qp2r/2b2Q2/2B5/1P4P1/P3RP1P/4R1K1 b - - 8 25,e6f5 e2e8,880", + "0017391f,rn3r1k/p4qb1/2p1p1Q1/1p2P1P1/3P1B2/2P3P1/P4PK1/7R b - - 1 25,h8g8 g6h7,1003", + "00174c49,6rr/p1Q1kppp/1p1p4/4p2n/4Pb1q/2PP1P2/P1P2PRP/6RK b - - 0 18,e7f6 c7d6,1356", + "00178cba,2kr1b1r/pppq1B1p/5np1/2N2b2/8/5Q2/PP3PPP/R1B2RK1 b - - 4 14,d7f7 f3b7,992", + "0017910b,2rq1rk1/5pp1/b3pb1p/p1n5/1p6/1P2PN2/P1Q2PPP/1BRN1RK1 b - - 2 19,a6f1 c2h7,1111", + "0017e723,r1b2knr/pp3p1p/2n5/3Q3N/2P5/3BP3/P5PP/qN3RK1 b - - 1 14,g8e7 d5f7,1209", + "001887ed,5r1k/2p2BBp/3b4/p7/4r1b1/P5Pq/1PP2Q1P/2K2R1R b - - 0 22,h8g7 f2f6,1363", + "00191ef4,6k1/1p3rB1/2p1ppQ1/r7/8/5qP1/5P2/5RKR b - - 0 33,f7g7 g6e8,1213", + "0019329d,r1b2b1k/1pq3pp/p5p1/3Qp3/3N4/1BP1P3/PP4PP/1R4K1 b - - 3 22,e5d4 d5g8,1066", + "001ade98,8/7p/1r2p2k/3p2pP/p1bN2P1/P1P5/1P3K2/1R6 b - - 0 37,e6e5 d4f5,895", + "001d5d06,2r2rk1/p2n1ppp/5n2/3p1q2/1R1Q2B1/1P2P1P1/1B1PK2P/7R b - - 2 22,f6g4 d4g7,1183", + "001dfd74,r4Q1k/3pQ2r/p5Kp/1p3Rp1/3p4/3q2P1/PP5P/8 b - - 0 35,a8f8 e7h7,1275", + "001eefd2,3r2r1/pp3ppk/2p2N2/4pPR1/4p2P/3P4/PPP4K/6R1 b - - 0 29,g7f6 g5h5,1203", + "001f5c71,r4rk1/pp1b1pp1/nqp1p2p/3p4/2PP4/PP1QPN2/2B2PPP/R3K2R b KQ - 2 14,b6d8 d3h7,933", + "00210d29,8/8/p2r4/1pk1Qp2/6p1/P3P1K1/3r1P2/8 b - - 2 42,d6d5 e5c7,1525", + "0022c3e4,3rk2r/ppp1ppbp/2B3p1/4q3/2P5/P2Q3P/1P2PP1P/3R1K1R b k - 0 15,b7c6 d3d8,1136", + "00238b97,2kr1b1r/B1p2ppp/1p4n1/4P3/5Pb1/2qB4/P1P2QPP/R2R2K1 b - - 1 16,f8c5 d3a6,1360", + "0023f96f,6R1/3r4/7p/p1R4k/1p3K2/1P5r/8/8 b - - 2 53,h5h4 g8g4,1296", + "00243e42,8/pp4p1/8/1k2R3/1P4P1/P6r/2PK1n2/8 b - - 1 33,b5a4 e5a5,1285", + "0024aec9,r5k1/1b1nqp1Q/2p1p3/1p6/2pP4/2P2P2/2B3PP/1R4K1 b - - 2 23,g8f8 h7h8,843", + "00259a38,2k2qrr/pb6/1p6/2p5/6p1/2PQ1PBn/PP5P/R2RN2K b - - 7 28,g4f3 d3d7,1456", + "0026cee7,r1bq1bkr/pp2pQp1/3pP2p/2p1n1N1/8/8/PPPP1PPP/RNB1K2R b KQ - 1 10,e5f7 e6f7,1088", + "0027dd31,r4qkr/pp6/2pb2R1/3p2p1/3P2Q1/6P1/PP3P1P/6K1 b - - 1 27,g8f7 g4e6,1675", + "0027e62f,r4rk1/pp2bppp/8/q3P3/4Q3/1P1BK1P1/P4P1P/n6R b - - 2 22,a5a2 e4h7,689", + "0027f601,8/q7/8/5Qpk/P7/7K/6P1/8 b - - 0 47,a7a4 f5h7,1462", + "0027f88e,7r/5pp1/4pkp1/p2p4/6q1/P7/1Q2R1P1/3KR2r b - - 11 33,e6e5 b2e5,1251", + "0028084e,1r6/p7/3pk1R1/2pNp2p/2Pnn3/P5P1/2r2PKP/8 b - - 0 34,e6f5 d5e7,1647", + "002a8583,5k2/5p1p/2Np1np1/8/4P3/5P2/3q2PP/Q6K b - - 2 31,f6h5 a1h8,1443", + "002ac525,4n1k1/5R2/6KN/2r5/8/8/8/8 b - - 34 69,g8h8 f7h7,814", + "002aeb5d,2krr3/Qpp4p/3p1q2/2P5/8/7P/PPP5/1K1R4 b - - 0 25,d6c5 a7a8,1001", + "002afbfe,3r3k/r1q1pQ1p/p4bpB/1ppnp1N1/8/P1PP4/1P3PPP/R3R1K1 b - - 13 22,f6g5 h6g7,995", + "002b0111,4r1k1/3b1Rp1/p3p1p1/3pQ1Nr/1p1N2qp/P7/1PP5/1K6 b - - 2 41,h5g5 e5g7,983", + "002b5f36,r4knr/ppq1p3/2p2pB1/2N3pp/2P3Q1/2P5/P4PPP/1R2R1K1 b - - 0 21,h5g4 c5e6,1207", + "002be842,4rrk1/1b3Rpp/3p4/8/1p2q1Pb/1BB4P/1PP4K/R4Q2 b - - 0 25,b4c3 f7f8,894", + "002c7a50,4nk2/3bQ3/p4P2/1p3N2/3pqPP1/8/BP3K2/8 b - - 3 45,e4e7 f6e7,1505", + "002cb331,3b4/8/6p1/p1p1ppk1/P1P5/1P3P1P/6K1/4B3 b - - 8 37,g5f4 e1d2,1612", + "002deac1,6k1/p4p1p/1p2p1pP/3pP1Q1/1rq2P2/8/6P1/6RK b - - 0 33,c4f4 g5d8,1023", + "002f9d45,r1b3k1/ppq1p2p/n5NB/3P1r2/8/7P/PQ2BPP1/1R4K1 b - - 0 22,h7g6 b2g7,1357", + "0030528e,4r2r/pp4Q1/2p2p2/5bk1/5N2/5B2/Pq2PP1P/3RK3 b - - 4 26,g5f4 g7g3,1450", + "00313552,r2q1rk1/p1p2ppp/1p2p3/3nN3/3PQ1P1/bP1B3P/1BP2P2/1K5R b - - 1 22,a3b2 e4h7,1030", + "0031d8be,r1b2r1k/ppp5/2nb2Q1/7N/3P3q/2P1P2P/P2B2P1/1R3RK1 b - - 2 20,f8g8 g6h6,1409", + "00325e62,4bB1k/1p3p1p/5PpN/3PK3/7r/7P/8/8 b - - 6 44,h4h3 f8g7,1232", + "0032989d,rn3rk1/pp3pp1/3p1q1p/8/4Q1b1/3B1N2/P1P2PPP/R4RK1 b - - 4 17,g4f3 e4h7,1085", + "003527cf,r4rk1/p2bqpp1/1p2p2p/2pn4/3P4/3QPN2/PPB2PPP/2R2RK1 b - - 1 18,d5b4 d3h7,899", + "00356657,3kr3/5Qp1/1p2p3/pq1pN3/4rP2/8/6PP/2R4K b - - 7 41,e4e5 f7c7,1124", + "0035bec1,8/5kQ1/3p4/p1pPpNn1/Ppn1P3/1P6/5rr1/2K5 b - - 3 77,f7e8 g7e7,1233", + "0035e304,r4rk1/pp1b1pp1/2p1p2p/q3P3/4Q3/2PB4/PP3PPP/R4RK1 b - - 4 18,a5c7 e4h7,725", + "0035fc14,8/3kRp2/3p2p1/3Np2p/2P1P2P/6PK/3r4/6b1 b - - 13 47,d7c6 e7c7,863", + "0036b8c8,2r2rk1/5pbp/p2p4/1p2pP2/2q5/P1P2PQ1/1P5P/R5RK b - - 1 25,c4f4 g3g7,1020", + "0037a318,8/1Q6/1p1r1kpp/5p2/1P1q4/8/1P3PPP/4R1K1 b - - 4 33,d4b4 b7e7,985", + "00387071,rn3rk1/p2nqppp/1p2p3/2pp2N1/3P3P/2PQP3/PP1N1PP1/R3K2R b KQ - 1 12,h7h6 d3h7,1116", + "00395259,4rQ1k/pb4pp/1pn5/3p2P1/6qP/1N6/PP5K/5R2 b - - 7 30,e8f8 f1f8,686", + "003a9280,r1b1k2r/pp1np2p/1q1pNpp1/2p2P2/4P3/1N1PB3/PP2B1PP/R3R1K1 b kq - 0 16,g6f5 e2h5,1284", + "003a98f6,5r2/Q5pk/1p5p/2p2b2/2P4P/1P6/PB3P1P/4qBK1 b - - 0 34,f5d3 a7g7,1028", + "003af2bf,5k2/5p1p/P4Pp1/2KP1rP1/8/1R2pb2/8/8 b - - 0 47,f3d5 b3b8,1033", + "003afa53,6k1/p5pp/1p2qp2/1Q5P/3pP3/3P4/2r1BK2/8 b - - 0 32,e6g4 b5e8,1140", + "003b2dcb,1r1R3k/4bQpp/8/4P1Pn/p4p1P/P4q2/1P6/1K1R4 b - - 7 35,e7d8 f7e8,825", + "003bf455,r1bqr1kb/pp1n1p1p/2pNp1pB/3n4/2BP4/5Q2/PPP1NPPP/3R1RK1 b - - 5 13,d7b6 f3f7,826", + "003da850,2kQr1n1/1pP3br/pB4p1/4qp2/4p3/8/PP4P1/2R2RK1 b - - 3 33,e8d8 c7d8q,805", + "003e0a43,r4r1k/5ppp/2p2b2/p4Q2/q3B3/5N2/2P3PP/3R3K b - - 0 28,f8e8 f5h7,1134", + "003e6f40,rnb1rk1Q/ppp1q3/4pn2/8/3P4/2Pp2R1/P1P3PP/R5K1 b - - 5 22,f8f7 g3g7,1072", + "003f3939,6r1/p1p2kp1/6b1/5pQ1/4P3/B2p1PP1/q7/5K1R b - - 1 33,d3d2 g5e7,1272", + "003f50b4,4q1k1/7p/3P2p1/p7/1p3QP1/3P1R1K/4r2P/8 b - - 2 40,e8d7 f4f8,617", + "003f8701,4nR1k/pp1nQ1pp/4p3/3pP2N/6q1/1N6/P1r3PP/7K b - - 2 25,d7f8 e7f8,973", + "003f9799,r1bqkb1r/pp1pnppp/2n5/1N2p3/2BpP3/5N2/PPP2PPP/R1BQK2R b KQkq - 1 6,a7a6 b5d6,972", + "0040726c,N1bk1R1r/pp1p2p1/6p1/3q4/8/2P3P1/PP3Q1P/6KR b - - 4 25,h8f8 f2f8,1145", + "004125a6,2b1nrk1/5p2/1q2p2p/8/3NQpP1/7P/PP6/1B1R2K1 b - - 1 32,e8g7 e4h7,945", + "0041fec8,r2q1rk1/2p1bppp/p4N2/1p6/1n1P2b1/3QBN2/PPB2PPP/R3R1K1 b - - 0 15,e7f6 d3h7,600", + "004323af,3r3k/p5pp/8/2p1q3/2P5/1P1R2P1/P6P/5QK1 b - - 0 29,d8d3 f1f8,1052", + "0043a610,rnbqr2k/2p2Qp1/pp1bNn2/3p4/2PP4/P1N1P2P/1P3P2/R1B1KBR1 b Q - 0 14,c8e6 f7g7,947", + "004404c4,r2Q1k1r/ppp1npp1/2p2q1p/8/1b2P2P/2N1B3/bPP2PP1/2KR1B1R b - - 3 12,a8d8 d1d8,600", + "00452b22,8/1k3Rp1/2b1p2p/2B5/P4K2/1r6/8/8 b - - 5 49,b7a6 f7a7,909", + "00455da1,8/p5r1/8/4NR2/1p4Rk/P7/1r4PK/8 b - - 0 37,g7g4 e5f3,1515", + "00467126,4r1k1/ppnq3p/6pB/2Q2p2/5P2/3PR2P/P5PK/8 b - - 5 34,e8e3 c5f8,1222", + "00474b6b,r2q1r1k/2p1bppn/b1Pp2P1/5PB1/3NP2Q/1P1B3P/P6K/R4R2 b - - 4 27,e7g5 h4h7,736", + "0047cc83,2rqr1k1/1b2bN1p/p3p1pB/1p1n4/2nP4/P1N5/1P2QPPP/1B1RR1K1 b - - 0 19,g8f7 e2e6,1649", + "0047ea6a,r3kb1r/2p1np1p/p1n3p1/1p1Np3/4P3/1B2BP2/PPP2P1P/2KR3R b k - 1 13,a8c8 d5f6,1265", + "00482b41,rnb1Rbk1/pp3Bpp/2p5/q7/8/2p5/PPPB2PP/5RK1 b - - 0 17,g8h8 e8f8,728", + "0048f486,r2r2k1/pQ4Rp/5p2/2p5/2q5/2B5/P4PPP/6K1 b - - 0 27,g8f8 b7e7,1593", + "0049b0c3,rn2r1k1/pp5p/3p3B/2p3p1/2P1Q3/2P5/P6P/R4RK1 b - - 0 24,e8e4 f1f8,628", + "004a3392,q5k1/5p1p/4p1pP/6P1/1pP5/2n4K/3Q3N/8 b - - 0 45,a8e4 d2d8,612", + "004a9f01,2kr1bnr/pp1nqp1b/2N1p2p/6p1/2BPNB1P/8/PPP1QPP1/R3K2R b KQ - 0 15,b7c6 c4a6,968", + "004b42d3,6rk/3q2p1/1n1P2Qp/p5N1/1pp4P/8/PP3PP1/5RK1 b - - 4 35,h6g5 g6h5,1090", + "004b9ac4,2bq1rk1/2np1ppp/8/p3P3/8/3Q1P2/PrBB2PP/3R1RK1 b - - 1 25,c8a6 d3h7,745", + "004c6e4b,5r1k/R6p/8/5pQ1/3P4/4P1P1/p4P1K/1q6 b - - 5 41,a2a1q g5g7,1047", + "004c91be,6k1/pp3p1Q/2p1p1B1/4q1pP/8/P1P3P1/3r1P2/6K1 b - - 5 34,g8f8 h7f7,1091", + "004cb7c0,3Rbk2/5rp1/6qp/4Q3/pPp5/P6P/5PP1/6K1 b - - 0 38,g6f6 e5e8,1208", + "004d4ca2,r3rk2/pp2bnnB/2p3N1/3p1b2/1q1P1N2/4P3/PP3PPP/R4K1R b - - 1 23,f5g6 f4g6,1657", + "004dd417,8/1R2k3/4p1P1/2np3K/2n2P2/1p6/8/q7 b - - 2 53,e7f6 b7f7,976", + "004dfd7c,r2q1bnr/ppp2kp1/2np3p/4P3/4P3/5Q2/PPPP2PP/RNB2RK1 b - - 0 8,f7g6 f3f5,1310", + "004e1f49,r1b2k1r/1pq3p1/p1np1pQ1/2pBp3/4P3/1P1P3P/P1P2PP1/R4RK1 b - - 3 19,c6e7 g6f7,972", + "004ec30a,2r1Q1k1/p4ppp/1r6/2p5/5B2/1P6/P1P2PPP/4R1K1 b - - 2 20,c8e8 e1e8,698", + "004eca66,r1b2r1k/p2p1p2/1p1p2p1/2bNnN2/4P3/7R/B1P2PPP/5RK1 b - - 4 25,h8g8 d5f6,1452", + "004f4377,r5nr/1pq1kppp/p3p3/b3Pb2/B2P4/Q7/PP2N1PP/R4RK1 b - - 1 17,e7d8 a3f8,1194", + "004fed7f,3k1b2/2q3p1/2Pp4/p4r1p/Pp1pQP2/7P/1PP5/2K1R3 b - - 1 31,f5c5 e4e8,687", + "00507b71,1r3r2/p2pb1pk/2p1pN1p/2Pb3P/1q4Pn/7B/P1Q1RP2/B3R1K1 b - - 2 34,h7h8 c2h7,948", + "005095ce,8/pp6/2n4p/6r1/2Q5/k7/2P2K2/6r1 b - - 7 42,g1g4 c4b3,1279", + "005318e0,5rk1/1pqb2p1/p1nbp1QB/3p1r1p/3Pp3/PBN5/1PP2PPP/R4R1K b - - 3 18,f5f6 g6g7,1018", + "0053527b,r2qk1nr/1bpp2p1/n3p2p/p3PpNQ/B2P4/8/1PP2PPP/RN3RK1 b kq - 1 13,e8f8 h5f7,1096", + "0053e505,r5k1/B4npp/8/8/4Rp1P/P4P2/1PP3P1/6K1 b - - 0 26,a8a7 e4e8,983", + "0055033c,2bq1rk1/r4ppp/3b1B2/pp6/3P4/1NPQ3P/PnB1N1P1/R4RK1 b - - 0 18,g7f6 d3h7,743", + "0055ce64,r3kr2/p2p1p1p/b1p1p3/1q6/3Q4/1NP5/P1P2PPP/2KR3R b q - 6 15,b5b6 d4d7,1113", + "005747c3,8/3PPk2/5P2/5K2/8/1p6/6p1/8 b - - 0 62,g2g1q e7e8q,1183", + "0057b80d,6k1/1r3ppp/2n1p3/B7/P7/8/5PPP/3R1K2 b - - 0 29,c6a5 d1d8,600", + "0058617e,rnbq1k1r/ppp1b1pp/8/3B3Q/4n3/8/PPPP1PPP/RNB1K2R b KQ - 0 8,e4f6 h5f7,792", + "0058b0e5,1r6/pp2R1k1/2pp1R1p/r4PpB/3P2P1/8/PPb4P/6K1 b - - 9 30,g7f6 e7f7,1264", + "0058c429,1r6/6p1/6p1/2Q1pq2/K1P2k2/P2p4/2r2P2/6R1 b - - 5 39,c2b2 c5e3,1088", + "0059b3b5,4rrk1/1pp3p1/p6p/5b2/2P1pP2/1P4Q1/1q1RK2P/6RB b - - 9 34,b2a3 g3g7,990", + "005ad4a4,6rk/8/3pbq1R/1p4r1/3p3Q/7P/1PR5/4K3 b - - 0 42,f6h6 h4h6,896", + "005ae13b,r2q1rk1/ppp2ppp/1n2b3/6N1/3P4/2PQ4/P4PPP/R1B2RK1 b - - 4 15,h7h6 d3h7,861", + "005b4394,2R5/5p2/4p2k/4P3/3P1K2/r7/6R1/4r3 b - - 9 49,a3a4 c8h8,1466", + "005b9953,r2q1rk1/2pb1pp1/ppnbp3/6NQ/3P4/2P1B2P/P1P2PP1/1R3RK1 b - - 3 14,f7f6 h5h7,1195", + "005d5883,r4r1k/pbp4p/1p1q2nQ/3P1p1N/2B4R/7P/PPP3P1/5R1K b - - 0 23,g6h4 h6g7,1286", + "005ded66,r2q1rk1/pp2bppp/8/2p1n1NQ/BnPp4/8/P4PPP/R1B2RK1 b - - 3 16,b4d3 h5h7,1161", + "005ef046,2r2r1k/1p1R2p1/p6R/1n4N1/8/1BP5/Pn4PP/6K1 b - - 0 31,g7h6 d7h7,1565", + "00614a6d,r2q3k/pppb3p/3p1n1Q/1B1Pp3/4p3/2N2P1P/PPP2P2/2K3R1 b - - 1 18,d7b5 h6g7,1337", + "006153df,r2qr1k1/1b3Rb1/pp4Qp/2pp2p1/1P6/P5BP/4B1P1/1N5K b - - 3 27,e8e7 g6g7,1090", + "00623207,5r1k/1bq3pp/1p1p1n2/2p1pBB1/1pP1n1RQ/7P/PP3PP1/R5K1 b - - 19 29,f6g4 h4h7,1008", + "0062b720,6k1/pp3pR1/5P2/3p1q1P/8/4r3/PP6/6RK b - - 0 33,g8f8 g7g8,898", + "006369e0,3r1rkR/5qb1/4p1p1/p1p1P1P1/1pP2P2/3nBBK1/7Q/7R b - - 4 35,g7h8 h2h8,1019", + "006375c7,3rr1k1/4bppp/p1q5/5N1n/Ppp1PBQ1/3P4/1PP3PP/R4RK1 b - - 9 21,h5f4 g4g7,1077", + "00643ca4,r7/6B1/2p1R2p/6p1/5p1k/1PP4P/P1b3PK/8 b - - 11 36,a8a2 e6h6,965", + "00643ef0,4rkR1/p3bp1p/5n2/4B2q/8/2Nr2Q1/P5PP/5R1K b - - 4 25,f6g8 g3g7,1201", + "00646525,r4k2/1bp3p1/p1p2q1p/8/1P2Q3/P2BR3/5PPP/6K1 b - - 6 28,a8e8 e4e8,1150", + "006572a5,3r3Q/ppp1kp1p/5B2/3P1p2/2P1r1q1/6P1/P3P2P/R5K1 b - - 5 22,e7d7 h8d8,938", + "0065759c,5k2/5P1r/4PK2/8/8/8/8/8 b - - 6 95,h7g7 e6e7,623", + "0066fd3f,4nr2/1p1qppkp/p2p2p1/3P1N2/4P3/2Q2P2/PP4PP/1KR5 b - - 4 20,g7g8 f5h6,1772", + "00680ea3,1r2r1k1/p4pp1/1p4qp/2p1PN2/3p1B1b/P2P3P/1PP3Q1/R4KR1 b - - 0 25,g6f5 g2g7,1270", + "00681c88,5rk1/5pP1/p3p3/3p4/7Q/2Pb1P2/qrPK3P/3R3R b - - 0 27,f8c8 h4h8,754", + "006834eb,6rk/p4R1p/np2p1q1/3pQ3/4P3/4b1P1/PP1N2KP/8 b - - 5 23,g8g7 f7f8,1281", + "00685987,r3rnk1/2q2pp1/2p2p1p/1p3N1P/p2P1bQ1/P1PBB3/1P3PP1/1K1R4 b - - 2 20,f4e3 g4g7,1348", + "0068a5a6,2r1r1k1/1p4bB/1q2p3/p5NQ/3p3n/2P5/PP3PP1/5RK1 b - - 4 29,g8f8 h5f7,1235", + "00690301,6k1/5p2/6pK/3p1R2/1r5P/4R1P1/8/7r b - - 0 40,g6f5 e3e8,615", + "0069a333,6k1/4p2p/3p1rPQ/2pq4/1p4P1/rP1P4/7P/1R3RK1 b - - 0 25,f6g6 f1f8,906", + "006a93e6,r1b2rk1/1p2b2B/pq3n2/3Pp3/P1p2Pn1/2N5/1PQ1N1P1/R1B1K2R b KQ - 0 17,f6h7 c2h7,980", + "006b0217,r2qr1k1/1bp2ppp/p2p2n1/1p3NP1/4PP2/2Q5/PPP4P/R1B2RK1 b - - 0 17,e8e4 c3g7,1161", + "006b4162,r5rk/1b3qp1/p1pb1p2/3p1P1Q/8/3B3R/PPP3PP/R1B4K b - - 0 22,f7h5 h3h5,1271", + "006c294f,r3r3/pp3k1p/2p1NppQ/3P4/8/7P/2q2PP1/5RK1 b - - 1 30,g6g5 h6g7,1281", + "006c6956,r3q1nr/1b1np1bp/p2pNk2/1pp2PB1/3P4/2N5/PPP3PP/R2Q1RK1 b - - 3 14,f6f7 d1h5,1270", + "006cd74a,r4rk1/3b1pp1/1q2p1P1/3p3Q/5P1P/1p6/PPP5/2KR3R b - - 0 22,b3a2 h5h7,1052", + "006d5efa,4rrk1/pp4pp/1q1b1n1B/2p1p3/2PpP3/1P1n1NQ1/P5PP/RN3R1K b - - 1 18,d3f4 g3g7,967", + "006e7e49,3r2k1/5ppp/p1q5/2PR4/3Qn3/1P5P/PB4P1/6K1 b - - 0 28,c6d5 d4g7,1143", + "006fc4a4,1r2R1k1/1b1Q1ppp/p1n3q1/1p6/8/P1P2N2/BP3PPP/6K1 b - - 2 23,b8e8 d7e8,1053", + "0070db15,r3kb1r/3b1ppp/p7/3Qp3/4P3/P3q3/1PP3PP/R4R1K b kq - 1 19,a8d8 d5f7,1249", + "0071f27c,r2qk2r/pp1n1pp1/2pb1np1/4p3/2BPN2P/5Q2/PPP2PP1/R1B1K2R b KQkq - 1 12,f6e4 f3f7,1167", + "007399ca,r2k1bnr/1pp1n3/p2pB3/3Pp2p/4P1p1/3Q1qB1/PPP1N3/2K2RR1 b - - 1 23,f3d3 f1f8,1267", + "00739d80,r5kr/4R2p/p2BQnp1/1p1p4/5P2/7P/PPP3q1/2KR4 b - - 1 24,g8f8 e6f7,1357", + "0073b652,r4rk1/pp5p/2p1qPp1/3p4/5P1Q/8/PPP3P1/2KR3R b - - 1 23,e6f6 h4h7,820", + "00742029,k4b1r/1p1rpppp/pB3n2/2R5/1q6/6Q1/P1P2PPP/5RK1 b - - 2 21,f6e4 c5c8,874", + "00751d37,6k1/5p1p/b1p1p1pP/3n4/pr2P3/8/2BR1PP1/2K4R b - - 0 29,d5c3 d2d8,655", + "00753f79,r3Q1k1/p4ppp/1p3q2/3n4/3P4/1P3N2/P4PPP/4R1K1 b - - 2 23,a8e8 e1e8,600", + "00758c3d,r1bqkb1r/ppp2Bp1/3p1n1p/4n1NQ/3pP3/8/PPP2PPP/RNB1K2R b KQkq - 0 8,e5f7 h5f7,937", + "00762806,2q2r1k/4b1p1/1r5p/2p1Q3/4Bp2/1P4P1/1BP4P/5R1K b - - 1 31,b6e6 e5g7,1199", + "00772091,4k3/4B1R1/5p2/3Bp3/P1P1P3/4b2p/5q2/7K b - - 12 45,e3f4 d5c6,1238", + "007741bc,r2qkb1r/ppp1nppp/3p4/4N3/2B1P1b1/2N5/PPPP2PP/R1BQK2R b KQkq - 0 7,g4d1 c4f7,1175", + "0077522b,Q7/p4rk1/5p1p/8/2P2q2/6R1/PP4PK/4r3 b - - 7 34,g7h7 a8g8,1195", + "007827a2,4rrk1/n4pp1/pp1p3p/3P3q/1PP3bP/P1B2BQ1/3N2P1/R5K1 b - - 2 24,g4f3 g3g7,1247", + "0079ba26,r1b2rk1/ppqn1ppp/2p1p3/3p2N1/2PP4/PP2P3/2Q2PPP/R3KB1R b KQ - 0 12,h7h6 c2h7,717", + "007aa5fa,r4rk1/ppp4p/7P/5p2/6qR/P1Q1P3/1P3PP1/R3K3 b Q - 4 25,g4h4 c3g7,1361", + "007abdf5,6R1/1p5Q/p2p4/3Pq1kp/1P3pp1/P3rP1P/6PK/8 b - - 5 33,g5h4 g8g4,1557", + "007ae416,7r/4qp2/6Rk/5Q2/pP1PpNp1/P3P1Pp/8/7K b - - 6 63,f7g6 f5g6,1014", + "007c5538,8/pp5p/2p3p1/3kR2b/8/2B3P1/PPK2P2/3r3r b - - 10 45,d5c4 b2b3,1596", + "007cc8d0,3r1rk1/pbq2ppp/2p1p3/1pPnP1N1/8/P2Q2P1/6PP/R2R3K b - - 4 21,d5e7 d3h7,945", + "007d272f,rq4k1/4bpp1/p3p2p/3b4/1Pp1R3/P4N1P/1Q3PP1/B1N3K1 b - - 0 24,d5e4 b2g7,1119", + "007d7501,rnbq1b1r/pppknBp1/3p3p/4Np2/4P3/1QP5/PP1P1PPP/RNB1K2R b KQ - 0 7,d6e5 b3e6,1184", + "007e1e63,3r1k2/ppN3pp/2p5/6b1/2B2n2/8/PP3P1P/4RK2 b - - 1 28,d8d2 e1e8,1166", + "007eed3d,2r5/6pp/8/R3pb2/1k1npp2/8/1P1r1PPP/R6K b - - 1 29,d4b3 a1a4,1249", + "007f53b4,r4rk1/1pq2p2/p2b3p/3p4/PPP2P2/8/1B4QP/R4NK1 b - - 2 21,g8h7 g2g7,1192", + "007f5fda,4R1k1/p4p1p/1pb2P2/2p4p/2P5/8/P2r1PP1/4R1K1 b - - 1 30,c6e8 e1e8,628", + "007f8119,2r3rk/5p1Q/1pq2Pp1/p1p5/3p4/1P3R2/1B1P2PP/R5K1 b - - 0 28,h8h7 f3h3,803", + "008236d2,2k5/R5Rp/3n4/8/3r2PK/7P/P1P1r3/8 b - - 0 31,e2e8 a7a8,1444", + "0082b5d7,1r3rk1/3p1p2/p3p3/8/2pP3R/7R/P1P3PP/6K1 b - - 2 26,b8b2 h3g3,1461", + "0082e460,r1k1q2r/np1bp1b1/p2p1n1p/BB4p1/2Q5/8/PPP1NPPP/2KR3R b - - 5 19,c8b8 c4c7,1174", + "00836ec8,2kr4/p1p1p1bp/3qN1p1/1p1p1r2/b2P4/B1P3QP/PRP2PP1/4R1K1 b - - 9 21,d6a3 g3c7,1385", + "008397b2,7Q/nbprkppN/1p2p2p/pPq1P3/P7/2P3P1/5PBP/4R1K1 b - - 1 24,c5c3 h8f8,1164", + "0083f645,r1b2rk1/3p1ppp/p3p3/8/2P5/2Q4P/PB3PP1/q3N1K1 b - - 0 20,a1a2 c3g7,703", + "00844415,r4r1k/p1qnbppp/1p2N3/8/1PN2P2/2Q4P/P4P2/2KR2R1 b - - 0 21,f7e6 c3g7,976", + "0084e9f6,r1bq1r1k/ppp2p2/2n2N1p/2b1p3/2B4Q/8/P2N1PPP/R4RK1 b - - 1 17,f8g8 h4h6,1262", + "0085e777,8/Q5b1/p2kp3/1p2qpN1/1P6/P7/4nPP1/5K2 b - - 5 46,d6d5 a7c5,1406", + "00861dbc,r6k/ppp1Q1pp/n2p4/3Pp3/7r/2N2q2/PPP2PRP/2R4K b - - 3 20,h4f4 e7g7,1373", + "0086c296,r1bk2r1/1p1pn3/p3pp2/B3n2Q/P3q2N/1B4P1/2P2P1P/R4RK1 b - - 2 20,b7b6 a5b6,1279", + "00876e8f,r1b2k1r/pp3ppp/1b4qn/1BB1p3/8/2P5/P4PPP/1R1Q1RK1 b - - 0 19,b6c5 d1d8,602", + "008862b8,2Q3k1/p2r1p1p/3p2p1/3P4/1KP3b1/1P2r3/PBq5/8 b - - 1 28,e3e8 c8e8,664", + "0089b8f8,4rRk1/pb4p1/1pr4p/3pP1q1/2pP4/2N5/PPQ3PP/1B3RK1 b - - 0 26,e8f8 c2h7,1205", + "008a098b,1r2r3/3n1q2/1p1Pp1Rk/p1p1P2p/2P1Qp2/P1NB1P2/5P1P/7K b - - 0 35,f7g6 e4g6,607", + "008a2337,8/5Kpk/8/1r3p2/4n1p1/8/8/2R5 b - - 1 58,g4g3 c1h1,1281", + "008a2ca9,3rr1k1/p1q2pp1/6n1/8/2b5/2Q3R1/P4PPP/2R3K1 b - - 1 24,g6f4 c3g7,943", + "008a797c,6k1/p4ppp/4p3/2Rp2rP/7K/1P3r2/P7/5R2 b - - 0 36,f3f1 c5c8,675", + "008aac03,6rk/pp1qbQpR/8/4B3/3p4/6P1/PP2P2P/6K1 b - - 0 23,h8h7 f7h5,1281", + "008acf59,2rR1k1r/2Q1n1p1/p4q1p/4Nb2/2N5/2P1R1P1/PP3P1P/6K1 b - - 2 23,c8d8 c7d8,1082", + "008c22d2,r1b4k/2p2qpp/p1np4/1p2p3/1P2P1n1/2P3P1/P1BNQ1KP/5RN1 b - - 0 21,f7g6 f1f8,990", + "008c3819,r1k1Q1r1/1b1p1p2/1ppP4/p1q5/7P/6N1/P4PP1/R3R1K1 b - - 4 24,g8e8 e1e8,1091", + "008d320a,3rk3/1bp4p/1p2PpP1/8/p7/Br4P1/N1Bb3P/K4R2 b - - 0 34,h7g6 c2g6,1144", + "008d5ada,r2k2Rr/p1p2p2/1pnp4/3N1B1p/3b1B1q/7P/PPP4K/R5Q1 b - - 3 23,h8g8 g1g8,1069", + "008de322,r2qkb1r/pp1nppp1/2pp1n1p/8/2B1P1b1/1QP2N2/PP1P1PPP/RNB1R1K1 b kq - 2 7,g4f3 c4f7,1170", + "008e82f9,5k2/1pb1Qp1p/p1p3p1/3q1N2/8/3r4/bP3PPP/4R1K1 b - - 1 33,f8g8 e7e8,1130", + "008ea34f,3r3r/pp2kQ2/1b6/3p4/3P4/5RP1/P4PKP/2q5 b - - 4 34,e7d6 f3f6,1233", + "008eaecc,2kr3r/p2n1ppp/8/bBpp1P2/3P1B2/8/1P2N1PP/5RK1 b - - 3 23,a5b6 b5a6,1326", + "008f0db7,rkb4r/pp1pq2B/5p2/4p3/8/8/PP1Q1PPP/2RR2K1 b - - 3 25,e7h7 d2d6,1074", + "008f1dd7,r3k2r/p3ppb1/1qp2npp/8/6b1/1PN1Q3/PBP2PP1/3RR1K1 b kq - 1 19,g4d1 e3e7,1444", + "008f1ebe,3r4/kp2b1p1/2p4p/5Q2/1p2BB2/1P4P1/5PK1/3q4 b - - 2 32,d1b3 f5a5,1005", +]; diff --git a/mods/bworld/scripts/minigames/maze.ts b/mods/bworld/scripts/minigames/maze.ts index 4ba84a7..47b3104 100644 --- a/mods/bworld/scripts/minigames/maze.ts +++ b/mods/bworld/scripts/minigames/maze.ts @@ -1,23 +1,13 @@ -import { FishingMinigame, type MinigameArgs, type MinigameScreen } from "./minigame.ts"; +import { FishingMinigame, type MinigameArgs, type MinigameScreen, SOLVE_TIME, time_bar } from "./minigame.ts"; -// a maze to take the mouse through without touching its walls, bigger the harder the fish is, in 8 seconds from when -// it opens whatever the difficulty. it's all played on the screen, which says how it went: button 1 when the mouse -// reaches the end, 0 when it touches a wall -const MAZE_TIME = 8 * 20; +// a maze to take the mouse through without touching its walls, bigger the harder the fish is, in SOLVE_TIME from +// when it opens whatever the difficulty. it's all played on the screen, which says how it went: button 1 when the +// mouse reaches the end, 0 when it touches a wall export class MazeMinigame extends FishingMinigame { - #ticks_left = MAZE_TIME; - constructor(...args: MinigameArgs) { super(...args); - this.menu.add_data("ticks_left", () => this.#ticks_left); - this.menu.add_data("time", () => MAZE_TIME); - this.menu.on_button((_player, id) => { - if (id === 1) this.win(); - else if (id === 0) this.lose(); - }); - this.menu.on_tick(() => { - if (--this.#ticks_left <= 0) this.lose(); - }); + this.listen_for_result(); + this.time_limit(SOLVE_TIME); } } @@ -47,8 +37,7 @@ export const maze_screen: MinigameScreen = (menu) => { inventory_overlays: false, on_render_labels(g) { g.rect(0, 0, size, size, [0.05, 0.1, 0.2, 0.6]); - const time_left = menu.data.ticks_left / menu.data.time || 0; - g.rect(0, size + MAZE_WALL, size * time_left, MAZE_WALL, [1 - time_left, time_left, 0.2, 1]); + time_bar(g, menu, 0, size + MAZE_WALL, size, MAZE_WALL); g.rect(start_x, start_y, pad, pad, started ? [0.5, 0.5, 0.2, 0.6] : [0.9, 0.8, 0.2, 1]); g.rect(end_x, end_y, pad, pad, [0.3, 0.85, 0.3, 1]); for (const [x, y, w, h] of walls) g.rect(x, y, w, h, [0.8, 0.8, 0.8, 1]); diff --git a/mods/bworld/scripts/minigames/minigame.ts b/mods/bworld/scripts/minigames/minigame.ts index d2e1e44..799b8f3 100644 --- a/mods/bworld/scripts/minigames/minigame.ts +++ b/mods/bworld/scripts/minigames/minigame.ts @@ -3,6 +3,9 @@ import type { ItemStack, MenuBuilder, Player } from "bworld/server"; import type { ClientMenu, Graphics, MenuScreen } from "bworld/client"; +// how long the puzzle minigames give the player, the maze and chess, whatever the difficulty +export const SOLVE_TIME = 8 * 20; + export type MinigameArgs = [menu: MenuBuilder, fish: ItemStack, player: Player, difficulty: number]; // a minigame's screen, with the fish it's for @@ -34,6 +37,24 @@ export abstract class FishingMinigame { this.#over = true; } + // for minigames played all on the screen: its button 1 lands the fish, 0 loses it + protected listen_for_result() { + this.menu.on_button((_player, id) => { + if (id === 1) this.win(); + else if (id === 0) this.lose(); + }); + } + + // loses the fish after this many ticks. the screen gets ticks_left and time, for time_bar + protected time_limit(ticks: number) { + let ticks_left = ticks; + this.menu.add_data("ticks_left", () => ticks_left); + this.menu.add_data("time", () => ticks); + this.menu.on_tick(() => { + if (--ticks_left <= 0) this.lose(); + }); + } + // keeps holding up to date with the mouse: the screen presses button 1 when it's pressed and 0 when it's let go protected holding = false; protected listen_for_mouse() { @@ -55,3 +76,9 @@ export function mouse_sender(menu: ClientMenu): (g: Graphics) => void { menu.click_button(holding ? 1 : 0); }; } + +// a time_limit's time left, as a bar that shrinks and goes from green to red +export function time_bar(g: Graphics, menu: ClientMenu, x: number, y: number, width: number, height: number) { + const left = menu.data.ticks_left / menu.data.time || 0; + g.rect(x, y, width * left, height, [1 - left, left, 0.2, 1]); +} diff --git a/mods/bworld/scripts/minigames/mod.ts b/mods/bworld/scripts/minigames/mod.ts index d79a036..e085ddb 100644 --- a/mods/bworld/scripts/minigames/mod.ts +++ b/mods/bworld/scripts/minigames/mod.ts @@ -1,6 +1,7 @@ // the fishing minigames by name, what a fish's bworld:fish "minigame" says: the class the server builds its menu with // and the screen the client draws it with. see minigame.ts import type { FishingMinigame, MinigameArgs, MinigameScreen } from "./minigame.ts"; +import { chess_screen, ChessMinigame } from "./chess.ts"; import { hold_screen, HoldMinigame } from "./hold.ts"; import { maze_screen, MazeMinigame } from "./maze.ts"; import { ring_screen, RingMinigame } from "./ring.ts"; @@ -16,4 +17,5 @@ export const MINIGAMES: Record< valley: { minigame: ValleyMinigame, screen: valley_screen }, ring: { minigame: RingMinigame, screen: ring_screen }, maze: { minigame: MazeMinigame, screen: maze_screen }, + chess: { minigame: ChessMinigame, screen: chess_screen }, }; diff --git a/mods/bworld/textures/bishop.png b/mods/bworld/textures/bishop.png new file mode 100644 index 0000000000000000000000000000000000000000..9569532bd48a32f59824055da54298d3f3d44b91 GIT binary patch literal 214 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5M?jcysy3fAP_V<( z#WBR9ckQHDz6Jx1=I)O{1^;u7A7XcI+EJSIM)~ITsqzgTp|PQJ_bx1WvDLG!-Y{`P zj{`%-+SpfVYz!~<-j|T7y?V;dxLe-YG%#bfWJ&_tWftuTQdfSQ`Ct@S{+)+CAX~}k z-jV6L9&M3VW~sb$WIA_YvgC}LnL){$H_Psw%5@=FcP-Na#)mq`?i{M#B@T2GgQu&X J%Q~loCIIehPf7p) literal 0 HcmV?d00001 diff --git a/mods/bworld/textures/black_bishop.png b/mods/bworld/textures/black_bishop.png new file mode 100644 index 0000000000000000000000000000000000000000..8c1050b28c361c156dde87b5a5ff2c4b5c2f1f0b GIT binary patch literal 211 zcmV;^04)EBP)fgm2YKko|rW%%KB6TdO}48P%GFGmjg!mtAV!^%uGEw31d&v zFNwD)Tqb7zmHhr+Vu90xh)}=Z6Awtr-R)2I>e|k*b~dkCKHWh+036NRD|y`UHM;-+ N002ovPDHLkV1j`rS+xKF literal 0 HcmV?d00001 diff --git a/mods/bworld/textures/black_king.png b/mods/bworld/textures/black_king.png new file mode 100644 index 0000000000000000000000000000000000000000..4f72c38704a012511a3c1445b47702bcc3884bbc GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`(>z@qLn`J>4RYi=puq9^jGgL# z|JtzfB1g7ariw0?l|=MCR~Q@QYwsx*z3*}{5_Q|dy6nLf-zQtAd}XgoompvU^Zhe_ zlHmS@K02D_hEfveu||NWm8WfQMwwX*YNX`L`y_x%#kg$$mqelF{r G5}E*dFHVC1 literal 0 HcmV?d00001 diff --git a/mods/bworld/textures/black_knight.png b/mods/bworld/textures/black_knight.png new file mode 100644 index 0000000000000000000000000000000000000000..583268d225e44422032856110c78dd345690134a GIT binary patch literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`y`CC*3DKQ9o9tUAx@xN2Gj{YmKMR x5>8td`Or)4DX8dPPxd2ac%a-hQ)JYD@<);T3K0RX|dPWAu* literal 0 HcmV?d00001 diff --git a/mods/bworld/textures/black_pawn.png b/mods/bworld/textures/black_pawn.png new file mode 100644 index 0000000000000000000000000000000000000000..3e12f8211ae6ae567d3d19b42fac29118cb188b5 GIT binary patch literal 160 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`>7Fi*Ar*7ZPV(krP~>r*e>leL zy}wOZnr?)Bhe4wrm#@cVwc9Q$wn`~HpL0m@_T5P-2O3l@XU(3JuH>JQE4p0!PT_{h z2ZbtCK7EVvWLhxg(wA_jKM&>KwC(WebJ=#ncH*<1!^NyW82)EYzHsTM&3~Yk44$rj JF6*2UngBT7J{@;`*O*$Q>?dg^~6`+YP=dN qnZ)7A_grYXSfBHr@;&Q6F!P;%uDRIr_-UYv7(8A5T-G@yGywn*xkx$y literal 0 HcmV?d00001 diff --git a/mods/bworld/textures/black_rook.png b/mods/bworld/textures/black_rook.png new file mode 100644 index 0000000000000000000000000000000000000000..ae30a9bb906bdd688ffbc60c172a0f6aeb44c744 GIT binary patch literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`O`a}}Ar*6uPDu7o8sTbtjxEuig36fz`FRT8N=Rk<||R&YuLl;uH0~&#K=7DNksY{mD|q_D)zD4 zgfH5tB^h30Z ma=!U`=eqBwJ_f#fz^Y}rq}Jt08XFnGH9xvXl3@nJvd0l04{h}nk)NG$N2~Eu zm5JibJ8BG*Q}$Knb_M%i;7s_o)zXjsshwzM&qOZK`3HsGT+&#-d`gY`Z$e94KrUtQboFyt=akR{0D9m^H~;_u literal 0 HcmV?d00001 diff --git a/mods/bworld/textures/knight.png b/mods/bworld/textures/knight.png new file mode 100644 index 0000000000000000000000000000000000000000..54f4f2e501936104a694dbc53540a3d66befe3bd GIT binary patch literal 210 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5M?jcysy3fAP_V_* z#WBR9ckZM_t^*1jt-8CW+?#K6?e=`jIX5oYa(LCu*Ax;xa%RPorEY0#3|kb_zGyin zUG;IFU|tbmvV21DR-Olnm(Ntczm$`7@68P3v-ka&SG*FK7#`p2&3iT}<=EGafSq9cs`x`-3O( zU|Pr2siMq4aCl?#@qiyG)yW-8nS+=oW}Ic=Rdh2pa}HQEan1`ShNG`uxIYqnu@7hu NgQu&X%Q~loCIFj^H+ld7 literal 0 HcmV?d00001 diff --git a/mods/bworld/textures/queen.png b/mods/bworld/textures/queen.png new file mode 100644 index 0000000000000000000000000000000000000000..32b4afb86aa725ae871039036309bedf1e6d8f90 GIT binary patch literal 203 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5M?jcysy3fAP_Wk1 z#WBR9ck84;z5@yz&ZRe(-ums{cXXdYSD)qduijIHekFMcGX^kJg|{;;P&3}P^}YSH zWo%Mx9Uf|yCX;-WCjGyeAQ`aum7z!3MW@f7Y#F{3x4coF66EB}y~C;ZT3y#=$D4-y xJZbd`RkNM8xJ|lic_pvqdYb){n3HlZnL3>%{>FLFb^4h&`J?^HXu`;=O!?4!u{4keb|e|@qRP5-3! v`hWVJxP&w3%$22fn*8}0zajWr`=&#zLDNnfE?UzDawvnRtDnm{r-UW|mflRA literal 0 HcmV?d00001 diff --git a/tests/fishing_test.ts b/tests/fishing_test.ts index 2353de6..d18a289 100644 --- a/tests/fishing_test.ts +++ b/tests/fishing_test.ts @@ -541,3 +541,28 @@ Deno.test("the maze minigame loses the fish after 8 seconds, whatever the diffic } }, "maze"); }); + +Deno.test("the chess minigame lands the fish when its screen says the mate was played, and has the maze's time", async () => { + const t = await setup(); + const closes = () => t.take(1).some((m: Msg) => m.type === "close_menu"); + await with_minigames(async () => { + t.send(1, { type: "chat", text: "/fish cod" }); + let opened = opened_menu(t.take(1)); + assertEquals(opened.data, { ticks_left: 160, time: 160 }); + t.send(1, { type: "menu_button", menu: opened.id, button: 0 }); + t.game.tick(); + assert(closes()); + assertEquals(t.fish().length, 0); + + t.send(1, { type: "chat", text: "/fish cod" }); + opened = opened_menu(t.take(1)); + t.send(1, { type: "menu_button", menu: opened.id, button: 1 }); + assertEquals(t.fish().map((i: Msg) => i.id), ["bworld:cod"]); + + t.send(1, { type: "chat", text: "/fish cod" }); + t.take(1); + for (let i = 0; i < 161; i++) t.game.tick(); + assert(closes()); + assertEquals(t.fish().length, 1); + }, "chess"); +});