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};
|
||||
}
|
||||
|
||||
function funniPrompt() {
|
||||
var inputText = prompt("Enter command");
|
||||
function funniPrompt(argument=null) {
|
||||
argument === null ? inputText = prompt("Enter command") : inputText = argument;
|
||||
// replace spaces with underscores
|
||||
inputAsArray = inputText.split(" ");
|
||||
var firstItem = inputAsArray[0];
|
||||
|
|
|
|||
Loading…
Reference in New Issue