feat: Move function to app scope

- Move randomIntFrom() to app.js
- Add global entry to jshint configuration
This commit is contained in:
sthag 2026-02-13 11:27:44 +01:00
parent 148f4e0a21
commit ddbd406fc8
3 changed files with 20 additions and 18 deletions

View file

@ -272,24 +272,6 @@ function loadCore() {
});
}
/**
* Gibt eine Zahl zwischen <min> und <max> aus.
* Die Werte <min> und <max> sind dabei mit eingeschlossen.
* Mit <pos> kann der Exponent für eine 10er-Teilung angegeben werden.
*
* @param {number} min
* @param {number} max
* @param {number} pos
* @returns {number}
*/
function randomIntFrom(min, max, pos = 0) {
pos = Math.pow(10, pos);
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor((Math.random() * (max - min + 1) + min) / pos) * pos;
}
/**
* Erstellt Kontext für hint-Objekt und ermöglicht das Entfernen des Ereignis.
*/