mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 16:22:56 +02:00
Implemented interactive tutorial!
This commit is contained in:
@@ -13,11 +13,11 @@ function sizeOfObject(obj) {
|
||||
//e.g. addOffset(100, 5) will return anything from 95 to 105.
|
||||
//The percentage argument must be between 0 and 100;
|
||||
function addOffset(n, percentage) {
|
||||
if (percentage < 0 || percentage > 100) {return ;}
|
||||
if (percentage < 0 || percentage > 100) {return;}
|
||||
|
||||
var offset = n * (percentage / 100);
|
||||
|
||||
return n * (Math.random() * (2 * offset) - offset);
|
||||
return n + ((Math.random() * (2 * offset)) - offset);
|
||||
}
|
||||
|
||||
//Given an element by its Id(usually an 'a' element), removes all event listeners
|
||||
@@ -27,5 +27,5 @@ function clearEventListeners(elemId) {
|
||||
if (elem == null) {console.log("ERR: Could not find element for: " + elemId); return null;}
|
||||
var newElem = elem.cloneNode(true);
|
||||
elem.parentNode.replaceChild(newElem, elem);
|
||||
return elem;
|
||||
return newElem;
|
||||
}
|
||||
Reference in New Issue
Block a user