diff --git a/.jshintrc b/.jshintrc index 29388b2..cd80937 100644 --- a/.jshintrc +++ b/.jshintrc @@ -27,6 +27,8 @@ "getClosestEdgeToMouse": true, "centerElementUnderCursor": true, "setAttributesAccordingToPosition": true, + "randomIntFrom": false, + "replaceLineBreaks": false, "HippieTaskBar": true } } diff --git a/source/code/hippie/app.js b/source/code/hippie/app.js index e5a26b8..9fa1e9d 100644 --- a/source/code/hippie/app.js +++ b/source/code/hippie/app.js @@ -405,6 +405,24 @@ function setAttributesAccordingToPosition(element, position, attributes) { }); } +/** + * Gibt eine Zahl zwischen und aus. + * Die Werte und sind dabei mit eingeschlossen. + * Mit 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; +} + // CONCEPTS // NOTE: Benutzt private Zuweisungen diff --git a/source/code/intro.js b/source/code/intro.js index 341df5e..bff5a87 100644 --- a/source/code/intro.js +++ b/source/code/intro.js @@ -272,24 +272,6 @@ function loadCore() { }); } -/** - * Gibt eine Zahl zwischen und aus. - * Die Werte und sind dabei mit eingeschlossen. - * Mit 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. */