nope
nope is a Cell-based Turing complete esoteric coding language created by User:yayimhere (rewritten by User:RainbowDash). nope supports negative numbers, this allows for addition and subtraction. anything thats not a command will be ignored. there exists labels like in BASIC but they can only be numbers In nope there is only 5 valid commands along with their arguments:
Commands | Description | Arguments |
---|---|---|
no_op | Does nothing | * |
jl | Jump to label if MP is less than or equal to zero | MP, LABEL |
peek | Prints out the value at MP | MP |
store | Store VALUE at MP | MP, VALUE |
no:op_add | MP1 + MP2 = MP3 | MP1, MP2, MP3 |
Tips
- nope allows for subtraction whenever you add a negative number with another number.
- you can GOTO labels by choosing a cell you always know is going to be 0 or less.
- you convert numbers outputted by the peek command to ASSCI for text output or to colors for image output
Code Examples
Hello World
store 0 72 peek 0 store 0 101 peek 0 store 0 108 peek 0 peek 0 store 1 111 peek 1 store 0 32 peek 0 store 0 119 peek 0 peek 1 store 0 114 peek 0 store 0 108 peek 0 store 0 100 peek 0
Count down from 100
store 0 -1 store 1 1 store 2 100 store 3 -100 :1 peek 2 no:op_add 1 3 3 no:op_add 2 0 2 jl 3 1
This works because there is a negative version of the number that is being incremented, the program stops once that number is equal to 1. While that is happening a positive version is being decremented and outputted giving you the output you see.
Interrupters
JavaScript - nope revised interrupter
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++ } }
turing completeness proof
this is a proof that nope is turing complete to translating to Minsky machine
notes:
- registers 1 and 2 are reserved for inc and dec
- n is a short term for n'th command(of the minsky machine). so for the thith command it would be n=5
- uses Short Minsky Machine Notation
so the program must start with:
store 1 -1 store 2 1
heres the translation:
℘xy | V :n jl y x no:op_add y 1 y -- ℘y | V :n no:op_add y 1 y
the halt is not needed for turing completeness. so this proove's turing completeness of nope