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:
O-01-67 2022-09-08 12:58:36 -04:00 committed by GitHub
parent 6a4cf5a6e7
commit 03d32a8f5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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];