summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.html4
-rw-r--r--js/wordsearch.js10
2 files changed, 7 insertions, 7 deletions
diff --git a/index.html b/index.html
index 358497e..f3cc9fd 100644
--- a/index.html
+++ b/index.html
@@ -21,9 +21,9 @@
</footer>
</main>
<script type="module">
- import { WordSearch } from './js/wordsearch.js';
+ import { Game } from './js/wordsearch.js';
- const game = new WordSearch({
+ const game = new Game({
container: 'gameboard',
words: ['Bangkok', 'Hong Kong', 'London', 'Macau', 'Istanbul', 'Dubai', 'Mecca', 'Antalya', 'Paris', 'Kuala Lumpur'],
});
diff --git a/js/wordsearch.js b/js/wordsearch.js
index c3390af..491c3de 100644
--- a/js/wordsearch.js
+++ b/js/wordsearch.js
@@ -588,7 +588,7 @@ class Handler {
}
}
-class WordSearch {
+class Game {
static #directions = DIRECTIONS;
/**
@@ -642,10 +642,10 @@ class WordSearch {
}
this.#settings = {
- ...WordSearch.#defaultSettings,
+ ...Game.#defaultSettings,
...settings,
colors: {
- ...WordSearch.#defaultSettings.colors,
+ ...Game.#defaultSettings.colors,
...(settings.colors && typeof settings.colors === 'object' ? settings.colors : {}),
},
};
@@ -723,7 +723,7 @@ class WordSearch {
* @returns {boolean}
*/
#placeWord(word, direction) {
- const step = WordSearch.#directions[direction];
+ const step = Game.#directions[direction];
if (!step) {
return false;
}
@@ -871,4 +871,4 @@ class WordSearch {
}
}
-export { WordSearch };
+export { Game };