User talk:RainbowDash

From Esolang
Jump to navigation Jump to search

on nope

hello. your work with my esolang is very good. but there is one error(by me) and that is labels are just commands. jump to nearest <command> like this:

store 1 1
jl 1 store 1 1

and with this the interpreter would become this right?:

function nope(inputPrgm){
    // Initialize Variables
    let memorysize = 3000
    let memory = new Array(3000).fill(0);
    inputPrgm = inputPrgm.toLowerCase();
    let words = inputPrgm.split(/[ \n/\\]+/);
    
    let i = 0;
    while (i < words.length) {
        switch(words[i]) {
            case "no_op":
                Function.prototype(); 
            break;
            case "store":
                memory[words[i+1]] = +words[i+2];
                i += 2
            break;
            case "jl":
                if(memory[words[i+1]] <= 0){
                    i = words.indexOf(words[i+2]);
                } else {
                    i += 2
                }
            break;
            case "peek":
                console.log(memory[words[i+1]]);
                i += 1
            break;
            case "no:op_add":
                Function.prototype(); 
                memory[words[i+3]] = memory[words[i+1]] + memory[words[i+2]];
                i += 3
            break;
        }
        i++
    }
}

also i would like to ask why is it turing complete? like yes it looks so but is there any proof? --Xff (talk) 14:39, 1 August 2024 (UTC)

Minsky machines probably work if you use MP 0 as a "label" as in:
store 0 0 (label 0)
...
store 0 1 (label 1)
...
store 0 2 (label 2)
...
jl 1 store 0 0 (jump to label 1)
(MP 0 is not used for anything else so it doesn't interfere with the rest of the program)

Then store 1 in MP 1 and store -1 in MP 2 so you can increment and decrement. --PkmnQ (talk) 11:44, 2 August 2024 (UTC)