is-even icon indicating copy to clipboard operation
is-even copied to clipboard

stop being slow asf, do millions of these in seconds

Open chirag350 opened this issue 3 years ago • 3 comments

const fs = require('fs');
var converter = require('number-to-words');
let currentNumber = 1; // Replace with that 

while (true) {
    currentNumber++;
    const noinwords = converter.toWords(currentNumber).replace(",", "");
    const nointitlecase = toTitleCase(noinwords);
    const noinuppercase = noinwords.toUpperCase();
    function isEven(n) {
        return n % 2 == 0;
     }
    const eOrO = isEven(currentNumber)
    const endresult = `else if(number === ${currentNumber} || number === "${currentNumber}" || number === "${noinwords}" || number === "${nointitlecase}" || number === "${noinuppercase}") return ${eOrO};\n`
    fs.appendFileSync('./index.js', endresult)
};

function toTitleCase(str) {
    return str.replace(
      /\w\S*/g,
      function(txt) {
        return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
      }
    );
  }

this thing does millions of numbers in seconds. run this script seperately

chirag350 avatar Aug 28 '21 18:08 chirag350

We understand your concern with efficiency. However, that code might break in eventual updates that the framework is a target of. And besides, it's very unreliable. What if my computer does not have a CPU? Or a BIOS battery?!

Thank you for understanding.

AntonioOliveira2 avatar Oct 26 '21 23:10 AntonioOliveira2

We understand your concern with efficiency. However, that code might break in eventual updates that the framework is a target of. And besides, it's very unreliable. What if my computer does not have a CPU? Or a BIOS battery?!

Thank you for understanding.

Ok but why are you running JS in a BIOS

andyman1222 avatar Feb 06 '23 21:02 andyman1222

We understand your concern with efficiency. However, that code might break in eventual updates that the framework is a target of. And besides, it's very unreliable. What if my computer does not have a CPU? Or a BIOS battery?! Thank you for understanding.

Ok but why are you running JS in a BIOS

Why aren't you running JS in your BIOS?

MagusWyvern avatar Feb 17 '23 05:02 MagusWyvern