uwu kawaii in javascript

To create uwu kawaii style text and ASCII art in JavaScript, we can use a combination of string manipulation and concatenation. Here's an example code snippet:

index.tsx
const message = "hello world";
let uwuMessage = "";

const uwuFaces = ["(^・ω・^ )", "(*^ω^)", "(⌒‿⌒)", "(≧◡≦)", "(づ。◕‿‿◕。)づ"];

for (let i = 0; i < message.length; i++) {
  let c = message.charAt(i);
  if (c === "l" || c === "r") {
    uwuMessage += "w";
  } else if (c === "L" || c === "R") {
    uwuMessage += "W";
  } else {
    uwuMessage += c;
  }
}

// add kawaii face at the end
uwuMessage += " " + uwuFaces[Math.floor(Math.random() * uwuFaces.length)];

console.log(uwuMessage);
486 chars
21 lines

In this example, we first define a normal message string "hello world". Then, we create an empty string for the uwu kawaii version of the message. We also define an array of different ASCII art faces that we can randomly add to the end of the message.

Next, we loop through each character in the original message and use conditional statements to replace "l" and "r" with "w" and "L" and "R" with "W". We add each modified character to the uwuMessage string.

Finally, we add a random kawaii face from the uwuFaces array to the end of the message and log the result to the console.

Output example: "hewwo wowld (⌒‿⌒)"

gistlibby LogSnag