Created
September 20, 2018 22:20
-
-
Save Vresod/e28e6009e98e2d9de99699eef48ca167 to your computer and use it in GitHub Desktop.
RNG. WIP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name RNG | |
// @namespace http://vresod.github.io | |
// @version 0.5 | |
// @description keyboard shortcuts | |
// @include * | |
// @author Vresod | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
if (e.ctrlKey && e.altKey && e.which == 89) { | |
var chance = prompt('0 to what number?', '5') | |
var number = Math.floor(Math.random() * (chance - 1)); // returns a random integer from 0 to chance | |
alert('Your number is ' +number+ '!'); | |
} | |
} | |
)(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment