Skip to content

Commit

Permalink
Update Chessboard.svelte
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatXliner committed Mar 15, 2022
1 parent 1de6cf4 commit 8385713
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/Chessboard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ TODO:
const PIECES = Object.values(import.meta.globEager('./assets/pieces/*.{png,svg,jpg}')).map(
(e) => e.default
);
$: buildState = position == null ? [...Array(size * size)] : convert(position);
$: if (position === null) {position = `${size} ${size * size}`}
$: buildState = convert(position);
if (size > 26) {
throw new Error('Size is too big (must be between 1 and 26)');
Expand Down

0 comments on commit 8385713

Please sign in to comment.