From 68c9b7560642c802ca3bfe6d7e0f7a8c54412c40 Mon Sep 17 00:00:00 2001 From: Zhineng Li Date: Thu, 30 Apr 2026 10:33:23 +0800 Subject: 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 --- js/utility.js | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 js/utility.js (limited to 'js/utility.js') 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; - } -} -- cgit v1.2.3