Skip to content

Commit 2fd3367

Browse files
authored
Merge pull request #17 from jwyce/update-beginner-position-typo
2 parents 13ce4cb + 7c59cf7 commit 2fd3367

File tree

5 files changed

+22
-17
lines changed

5 files changed

+22
-17
lines changed

.changeset/clever-emus-turn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gungi.js': patch
3+
---
4+
5+
technically a breaking change but fixes typo of constant BEGINNNER_POSTION to be BEGINNER_POSITION

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const TACTICIAN = '謀';
8282
// starting positions (in FEN)
8383
export const INTRO_POSITION =
8484
'3img3/1s2n2s1/d1fwdwf1d/9/9/9/D1FWDWF1D/1S2N2S1/3GMI3 J2N2R2D1/j2n2r2d1 w 0 - 1';
85-
export const BEGINNNER_POSITION =
85+
export const BEGINNER_POSITION =
8686
'3img3/1ra1n1as1/d1fwdwf1d/9/9/9/D1FWDWF1D/1SA1N1AR1/3GMI3 J2N2S1R1D1/j2n2s1r1d1 w 1 - 1';
8787
export const INTERMEDIATE_POSITION =
8888
'9/9/9/9/9/9/9/9/9 M1G1I1J2W2N3R2S2F2D4C1A2K1T1/m1g1i1j2w2n3r2s2f2d4c1a2k1t1 w 2 wb 1';
@@ -125,7 +125,7 @@ let gungi = new Gungi(
125125
Returns a string containing an ASCII diagram of the current position with ANSI colors. Options is an optional parameter which may contain a 'english' flag to display the pieces in English symbols.
126126

127127
```ts
128-
const gungi = new Gungi(BEGINNNER_POSITION);
128+
const gungi = new Gungi(BEGINNER_POSITION);
129129

130130
// make some moves
131131
gungi.move('槍(8-5-1)(7-5-2)付');
@@ -232,7 +232,7 @@ gungi.board();
232232
Returns a list of pieces captured. Color is an optional parameter to filter pieces by player color
233233

234234
```ts
235-
const gungi = new Gungi(BEGINNNER_POSITION);
235+
const gungi = new Gungi(BEGINNER_POSITION);
236236
gungi.move('新小(7-5-2)付');
237237
gungi.move('兵(3-5-1)(4-5-1)');
238238
gungi.move('新槍(7-4-2)付');
@@ -258,7 +258,7 @@ gungi.fen();
258258
Returns the FEN string for the current position.
259259

260260
```ts
261-
const gungi = new Gungi(BEGINNNER_POSITION);
261+
const gungi = new Gungi(BEGINNER_POSITION);
262262

263263
// make some moves
264264
gungi.move('槍(8-5-1)(7-5-2)付');
@@ -274,7 +274,7 @@ gungi.fen();
274274
Returns the tower of pieces on the square. Returns `undefined` if the square is empty.
275275

276276
```ts
277-
const gungi = new Gungi(BEGINNNER_POSITION);
277+
const gungi = new Gungi(BEGINNER_POSITION);
278278

279279
gungi.move('砦(7-3-1)(7-4-2)付');
280280

@@ -304,7 +304,7 @@ gungi.getDraftingRights('b');
304304
Returns the top piece of the tower on the square. Returns `undefined` if the square is empty.
305305

306306
```ts
307-
const gungi = new Gungi(BEGINNNER_POSITION);
307+
const gungi = new Gungi(BEGINNER_POSITION);
308308

309309
gungi.get('7-4');
310310
// -> [{ square: '7-4', tier: 1, type: '侍', color: 'w' }]
@@ -317,7 +317,7 @@ gungi.get('7-3');
317317
Returns a list of pieces in players' hand. Color is an optional parameter to filter pieces by player color
318318

319319
```ts
320-
const gungi = new Gungi(BEGINNNER_POSITION);
320+
const gungi = new Gungi(BEGINNER_POSITION);
321321

322322
// make some moves
323323
gungi.move('槍(8-5-1)(7-5-2)付');
@@ -350,7 +350,7 @@ Returns a list containing the moves of the current game. Options is an optional
350350
A FEN string of the position prior to the move being made is added to the verbose history output.
351351

352352
```ts
353-
const gungi = new Gungi(BEGINNNER_POSITION);
353+
const gungi = new Gungi(BEGINNER_POSITION);
354354
gungi.move('新小(7-5-2)付');
355355
gungi.move('兵(3-5-1)(4-5-1)');
356356
gungi.move('新槍(7-4-2)付');
@@ -700,7 +700,7 @@ The `before` and `after` keys contain the FEN of the position before and after t
700700
Returns the game in PGN format. Options is an optional parameter which may include max width and/or a newline character settings.
701701

702702
```ts
703-
const gungi = new Gungi(BEGINNNER_POSITION);
703+
const gungi = new Gungi(BEGINNER_POSITION);
704704
gungi.move('槍(8-5-1)(7-5-2)付');
705705
gungi.move('新馬(1-7-1)');
706706
gungi.move('新忍(8-7-2)付');
@@ -734,7 +734,7 @@ gungi.turn();
734734
Takeback the last half-move, returning a move object if successful, otherwise null.
735735

736736
```ts
737-
const gungi = new Gungi(BEGINNNER_POSITION);
737+
const gungi = new Gungi(BEGINNER_POSITION);
738738

739739
gungi.fen();
740740
// -> '3img3/1ra1n1as1/d1fwdwf1d/9/9/9/D1FWDWF1D/1SA1N1AR1/3GMI3 J2N2S1R1D1/j2n2s1r1d1 w 1 - 1'

src/gungi/fen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ import {
6767

6868
export const INTRO_POSITION =
6969
'3img3/1s2n2s1/d1fwdwf1d/9/9/9/D1FWDWF1D/1S2N2S1/3GMI3 J2N2R2D1/j2n2r2d1 w 0 - 1';
70-
export const BEGINNNER_POSITION =
70+
export const BEGINNER_POSITION =
7171
'3img3/1ra1n1as1/d1fwdwf1d/9/9/9/D1FWDWF1D/1SA1N1AR1/3GMI3 J2N2S1R1D1/j2n2s1r1d1 w 1 - 1';
7272
export const INTERMEDIATE_POSITION =
7373
'9/9/9/9/9/9/9/9/9 M1G1I1J2W2N3R2S2F2D4C1A2K1T1/m1g1i1j2w2n3r2s2f2d4c1a2k1t1 w 2 wb 1';

src/gungi/gungi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pc from 'picocolors';
22
import {
33
ADVANCED_POSITION,
4-
BEGINNNER_POSITION,
4+
BEGINNER_POSITION,
55
encodeFEN,
66
INTERMEDIATE_POSITION,
77
INTRO_POSITION,
@@ -70,7 +70,7 @@ export {
7070
BETRAY,
7171
ARATA,
7272
INTRO_POSITION,
73-
BEGINNNER_POSITION,
73+
BEGINNER_POSITION,
7474
INTERMEDIATE_POSITION,
7575
ADVANCED_POSITION,
7676
SQUARES,

test/fen.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { describe, expect, it } from 'vitest';
22
import {
33
ADVANCED_POSITION,
4-
BEGINNNER_POSITION,
4+
BEGINNER_POSITION,
55
encodeFEN,
66
INTERMEDIATE_POSITION,
77
INTRO_POSITION,
@@ -38,8 +38,8 @@ describe('parseFEN', () => {
3838
});
3939
});
4040

41-
it('should correctly parse the BEGINNNER_POSITION string', () => {
42-
const result = parseFEN(BEGINNNER_POSITION);
41+
it('should correctly parse the BEGINNER_POSITION string', () => {
42+
const result = parseFEN(BEGINNER_POSITION);
4343

4444
expect(result.turn).toBe('w');
4545
expect(result.mode).toBe('beginner' as SetupMode);
@@ -265,7 +265,7 @@ describe('parseFEN', () => {
265265

266266
describe('validateFen', () => {
267267
it('should validate a correct FEN string', () => {
268-
const result = validateFen(BEGINNNER_POSITION);
268+
const result = validateFen(BEGINNER_POSITION);
269269
expect(result.ok).toBe(true);
270270
});
271271

0 commit comments

Comments
 (0)