Added argument support for funniPrompt()
-- as in, you can pass a command string as a string and have that be the input; running
> `funniPrompt("countall")`
is the same as running `funniPrompt()` and then entering `countall`.
Tested with
> funniPrompt("set element wall brick")
> funniPrompt("set amogussussy all water string")
> funniPrompt("nonexistyasdf")
> funniPrompt("countall")
This commit is contained in:
parent
6a4cf5a6e7
commit
03d32a8f5b
|
|
@ -35,8 +35,8 @@ function hslStringToUnvalidatedObject(string) {
|
||||||
return {h: hue, s: saturation, l: lightness};
|
return {h: hue, s: saturation, l: lightness};
|
||||||
}
|
}
|
||||||
|
|
||||||
function funniPrompt() {
|
function funniPrompt(argument=null) {
|
||||||
var inputText = prompt("Enter command");
|
argument === null ? inputText = prompt("Enter command") : inputText = argument;
|
||||||
// replace spaces with underscores
|
// replace spaces with underscores
|
||||||
inputAsArray = inputText.split(" ");
|
inputAsArray = inputText.split(" ");
|
||||||
var firstItem = inputAsArray[0];
|
var firstItem = inputAsArray[0];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue