Page 1 of 1

Program

Posted: 08 Mar 2026 20:58
by blamblammy
Hello all,

Some weeks ago, after I made my first post on this forum, I took a break from studying the site. I became a bit preoccupied with some run-of-the-mill day-to-day obligations, as does everyone. Anyways, I have decided to continue my study. Today I typed up a program that algorithmizes some of the patterns I've discovered so far, and it'll hopefully aid me in my quest for knowledge.

Image

If you're wondering, this is in JavaScript. I was going to do it in Java at first, but I didn't feel like making a new class just to get these algorithms into methods. I did this on: https://www.programiz.com/javascript/online-compiler/

Re: Program

Posted: 08 Mar 2026 21:04
by blamblammy
Here's the program in proper text form if you wanna use it yourself:

Code: Select all


console.log(translate("NINE"));

function translate(str){
    var charsProduct=1;
    var l=str.length;
    /* 
    Increments by 2 so that it fits with formula
    Formula is: 2(a+b)...+99, where (a+b) is a group of two letters
    */
    for(var i=0;i<l;i+=2){
        var mult=toNum(str[i]);
        mult+=str[i+1]!=undefined?toNum(str[i+1]):0;
        charsProduct*=mult;
    }
    // Using my formula
    return 2*charsProduct+99;
}

function toNum(char){
    /*
    ASCII values for all uppercase letters start at 65
    65-64=1, 66-64=2 and so on
    */
    return char.toUpperCase().charCodeAt(0)-64;
}


Re: Program

Posted: 08 Mar 2026 21:15
by blamblammy
In addition, someone please tell me if what I'm sharing is too much information. I do not take it that this community has the desire to gatekeep any "secrets", however, I understand that, in the case that the journey of acquiring this understanding is most certainly more rewarding than the knowledge it entails itself, I may be potentially depriving anyone of spiritual and intellectual growth.