Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
khaled-0 committed Feb 7, 2024
1 parent 0a03993 commit 69117c3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
9 changes: 4 additions & 5 deletions src/lib/components/Board/Board.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
// Loop around single row with right and left arrows
case 'ArrowRight':
while (true) {
while (nextCol != width) {
if (nextCol == width) {
nextCol--;
break;
Expand All @@ -61,7 +61,7 @@
break;
case 'ArrowLeft':
while (true) {
while (prevCol + 1 != 0) {
if (prevCol + 1 == 0) {
prevCol++;
break;
Expand All @@ -74,7 +74,7 @@
// loop around single column with up and down arrows
case 'ArrowUp':
while (true) {
while (prevRow + 1 != 0) {
if (prevRow + 1 == 0) {
prevRow++;
break;
Expand All @@ -86,7 +86,7 @@
break;
case 'ArrowDown':
while (true) {
while (nextRow != height) {
if (nextRow == height) {
nextRow--;
break;
Expand Down Expand Up @@ -155,7 +155,6 @@
});
</script>

<!-- TODO better unfocus method rather than relying on timeout -->
<BoardView
{boardData}
{boardHint}
Expand Down
17 changes: 10 additions & 7 deletions src/routes/game/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import type { PageData } from './$types';
import * as PreferenceHandler from '$lib/components/Preference/PreferenceHandler';
import preventTabClose from '$lib/utils/preventTabClose';
// import AlertBoard from '$lib/components/AlertBoard.svelte';
export let data: PageData;
Expand Down Expand Up @@ -59,16 +60,16 @@
existingWords.push(...score.words);
});
calculateInputScore(data.boardData, data.submitRow, data.submitColumn, existingWords)
.then((result) => {
calculateInputScore(data.boardData, data.submitRow, data.submitColumn, existingWords).then(
(result) => {
playerScores[data.submittedPlayerId].score += result.score;
playerScores[data.submittedPlayerId].words.push(...result.words);
//TODO Visualize scores
})
.catch((err) => {
//TODO
console.log(err);
});
// for (const word in result.words) {
// }
}
);
}
function handleGameOver(): void {
Expand Down Expand Up @@ -97,6 +98,8 @@
/>
</div>

<!-- <AlertBoard message="SussyBaka scored 69points with <p color='red'>amongus</p>" /> -->

<PreferenceDialog
bind:dialog={preferenceDialog}
bind:boardHint
Expand Down

0 comments on commit 69117c3

Please sign in to comment.