Quantcast
Channel: Interpret TwoMega - Code Golf Stack Exchange
Browsing latest articles
Browse All 6 View Live

Answer by DLosc for Interpret TwoMega

Pip, 75 71 byteslPB0aR:^"!><[].^_""!:_--viPU0++vW_{}O_i@v:!_LFBilPB0l@FBi"^n;VauTry it online!Translates the 2Ω code into equivalent Pip code and evaluates it.We use i to represent the tape, v...

View Article



Answer by Nitrodon for Interpret TwoMega

Brain-Flak Classic, 816...

View Article

Answer by Lynn for Interpret TwoMega

Python 2, 167 bytest=h=I=0m=1E=''for c in input():i='[<>!.^]'.find(c);E+=''*I+'while+2**t&h: m/=2 m*=2 h^=2**t print+(2**t&h>0) t=t&~m|m*(2**t&h<1)...

View Article

Answer by fergusq for Interpret TwoMega

Python 3, 297284 274 bytes-10 bytes thanks to ovs and Jonathan AllanC=input()h={}t=set()def f(C,p): c=C[0];r=hash(frozenset(t));v=h.get(r,0) p={"<":p-1,">":p+1}.get(c,p) if'"'>c:h[r]=not v...

View Article

Answer by l4m2 for Interpret TwoMega

JavaScript (Node.js), 148 bytesx=>eval(x.replace(e=/./g,c=>({'<':'u/=2','>':'u*=2','!':'e[v]^=1','.':'alert(+!!e[v])','^':'v=(v|u)^u*e[v]','[':'while(e[v]){'}[c]||'}')+';',v=u=1))Try it...

View Article


Interpret TwoMega

In this challenge, you will write an interpreter for 2Ω (transcribed as TwoMega), a language based loosely on brainfuck with an infinite-dimensional storage space.The Language2Ω contains three pieces...

View Article
Browsing latest articles
Browse All 6 View Live




Latest Images