diff options
| author | Zhineng Li <[email protected]> | 2026-04-30 10:33:23 +0800 |
|---|---|---|
| committer | Zhineng Li <[email protected]> | 2026-04-30 10:34:20 +0800 |
| commit | 68c9b7560642c802ca3bfe6d7e0f7a8c54412c40 (patch) | |
| tree | a262f6e37f4991cc5c8d88b50993c58af722e70c /js/utility.js | |
| parent | 6f2282ca7c13fdb43f21e8f52ac20235ff7e4ded (diff) | |
| download | word-search-game-68c9b7560642c802ca3bfe6d7e0f7a8c54412c40.tar.gz word-search-game-68c9b7560642c802ca3bfe6d7e0f7a8c54412c40.zip | |
keyboard & touch navigation, configurable settings, and refactor
- keyboard support: arrow keys or `hjkl` to move cursor, Space to start
selection, Enter to confirm, Escape to cancel
- configurable settings: word placement directions, grid size, cell
size, colors, fonts, debug mode, and more via `GameSettings`
- modernize CSS (logical properties, grid layout) and HTML semantics
- refactor JavaScript code around single-responsibility principles
Diffstat (limited to 'js/utility.js')
| -rw-r--r-- | js/utility.js | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/js/utility.js b/js/utility.js deleted file mode 100644 index fe1d0f1..0000000 --- a/js/utility.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Returns a random integer between min and max - * - * @param {Number} min - * @param {Number} max - * @return {Number} - */ -if (typeof Math.rangeInt != 'function') { - Math.rangeInt = function(min, max){ - if (max == undefined) { - max = min; - min = 0; - } - return Math.floor(Math.random() * (max - min + 1)) + min; - } -} - -/** - * Mege two objects - * - * @param {Object} o1 Object 1 - * @param {Object} o2 Object 2 - * @return {Object} - */ -if (typeof Object.merge != 'function') { - Object.merge = function(o1, o2) { - for (var i in o1) { - o2[i] = o1[i]; - } - return o2; - } -} |
