add zero-width space

This commit is contained in:
Chloe Fontenot 🏳️‍⚧️ 2023-04-09 09:20:06 -05:00
parent 0d7c7b6647
commit 2745467dbb

View File

@ -48,7 +48,7 @@ module.exports = {
//await interaction.reply('Error: String is too big. Resultant output would be too big to send to Discord. (the output length was ' + (output.length + testLength.length) + " characters.)"); //await interaction.reply('Error: String is too big. Resultant output would be too big to send to Discord. (the output length was ' + (output.length + testLength.length) + " characters.)");
let replyString = "output length was " + (output.length) + " characters."; let replyString = "output length was " + (output.length) + " characters.";
let filePath = writeFile(output); let filePath = writeFile(output);
await interaction.reply({content:replyString, files: [filePath] }); await interaction.reply({ content: replyString, files: [filePath] });
fs.unlinkSync(filePath); // Delete file once we're done with it fs.unlinkSync(filePath); // Delete file once we're done with it
} else { } else {
await interaction.reply(codeBlock("", output) + testLength); await interaction.reply(codeBlock("", output) + testLength);
@ -60,7 +60,7 @@ module.exports = {
function writeFile(content) { function writeFile(content) {
//console.log(content); //console.log(content);
console.log("Attempting to write string to file..."); console.log("Attempting to write string to file...");
let filename = Date.now()+'.txt'; let filename = Date.now() + '.txt';
console.log(filename); console.log(filename);
var filePath = path.join(__dirname, '..', filename); var filePath = path.join(__dirname, '..', filename);
console.log(filePath); console.log(filePath);
@ -214,12 +214,13 @@ var charIterateState;
function charIterate(input) { function charIterate(input) {
if (charIterateState == undefined) { if (charIterateState == undefined) {
charIterateState = 0; charIterateState = 0;
} } else {
if (charIterateState < (input.length - 1)) { if (charIterateState < (input.length - 1)) {
charIterateState++; charIterateState++;
} else { } else {
charIterateState = 0; charIterateState = 0;
} }
}
console.log(charIterateState, input.charAt(charIterateState)); console.log(charIterateState, input.charAt(charIterateState));
return charIterateState; return charIterateState;
} }
@ -261,7 +262,7 @@ function design5(input) {
if (dist > radius - 1 && dist < radius + 1) { //&& dist > radius - 1 if (dist > radius - 1 && dist < radius + 1) { //&& dist > radius - 1
lineHasInput = true; lineHasInput = true;
outputLine += ""+ input.charAt(charIterate(input)); //zero-width space outputLine += "" + input.charAt(charIterate(input)); //zero-width space
} else { } else {
outputLine += " "; outputLine += " ";
} }