ezcript
Version:
a package to make javascript more easy
31 lines (26 loc) • 625 B
JavaScript
const prompt = require("prompt-sync")({ sigint:true });
function input(al){
prompt(al);
}
function between(min, max) {
return Math.floor(
Math.random() * (max - min + 1) + min
)
}
function sqrt(a){
return a*a
}
function range(size, startAt = 0) {
return [...Array(size).keys()].map(i => i + startAt);
}
function characterRange(startChar, endChar) {
return String.fromCharCode(...range(endChar.charCodeAt(0) -
startChar.charCodeAt(0), startChar.charCodeAt(0)))
}
module.exports = {
input,
between,
sqrt,
range,
characterRange
}