From 174cd9a94dbbc22022b9147ff7fd69027401881b Mon Sep 17 00:00:00 2001 From: Adil Sadqi <42699429+AdilSadqi@users.noreply.github.com> Date: Sun, 7 Apr 2024 06:51:40 +0000 Subject: [PATCH] Update main.js.download --- index_files/main.js.download | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/index_files/main.js.download b/index_files/main.js.download index d36b0cb..2a2426e 100644 --- a/index_files/main.js.download +++ b/index_files/main.js.download @@ -269,6 +269,35 @@ function commander(cmd) { addLine("Invalid input. Please enter a valid number of digits.", "color2", 80); } break; + case "cowsay": + // Function to display a message with a cow saying it + function cowsay(message) { + var cow = ` + \\ ^__^ + \\ (oo)\\_______ + (__)\\ )\\/\\ + ||----w | + || ||`; + + var bubble = " " + "_".repeat(message.length + 2); + bubble += "\n< " + message + " >\n"; + bubble += " " + "-".repeat(message.length + 2); + + return cow + "\n" + bubble; + } + + // Prompt the user to enter a message for the cow to say + var message = prompt("Enter a message for the cow to say:"); + + // Validate the input + if (message) { + // Display the cow saying the message + console.log(cowsay(message)); + } else { + // Display an error message if the input is empty + console.log("Please enter a message for the cow to say."); + } + break; case "sudo": addLine("Oh no, you're not admin...", "color2", 80);