add: random()
This commit is contained in:
@@ -19,6 +19,8 @@ module.exports = function(__runtime__, scope){
|
||||
return !isStopped();
|
||||
}
|
||||
|
||||
scope.isRunning = scope.notStopped;
|
||||
|
||||
scope.exit = function(){
|
||||
__runtime__.exit();
|
||||
}
|
||||
@@ -55,5 +57,12 @@ module.exports = function(__runtime__, scope){
|
||||
}
|
||||
}
|
||||
|
||||
scope.random = function(min, max){
|
||||
if(arguments.length == 0){
|
||||
return Math.random();
|
||||
}
|
||||
return Math.floor(Math.random() * (max - min + 1)) + min;
|
||||
}
|
||||
|
||||
scope.setScreenMetrics = __runtime__.setScreenMetrics.bind(__runtime__);
|
||||
}
|
||||
Reference in New Issue
Block a user