From 4ca083e570b47dc70498d63c85656c04004c9834 Mon Sep 17 00:00:00 2001 From: Oliver Akins Date: Wed, 20 Jul 2022 21:12:20 -0600 Subject: [PATCH] Make the code only compute the proper main area index one time --- web-svelte/src/components/Board.svelte | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/web-svelte/src/components/Board.svelte b/web-svelte/src/components/Board.svelte index 282ca68..8956e17 100644 --- a/web-svelte/src/components/Board.svelte +++ b/web-svelte/src/components/Board.svelte @@ -95,18 +95,19 @@ function calculateMidNumber(row: number, col: number) {
- {#each Array(5) as _, r} -
- {#each Array(10) as _, c} + {#each Array(5) as _, row} +
+ {#each Array(10) as _, col} + {@const boardIndex = col + (( row * 10 ) + (1 * row))}
- {#if board[calculateMidNumber(r, c)] != null} + {#if board[boardIndex] != null}
{/if}