Kak-

From Esolang
Jump to navigation Jump to search
This article is not detailed enough and needs to be expanded. Please help us by adding some more information.

Kak- is esolang that minimises Kak. It has 2 commands. The programm is inside loop that end if by the end of the program bit is 0.

Commands

! - same as Kak
I - skip next instruction if bit is 0 and move pointer left

Translation to Kak

Kak Kak-
< I followed by space
! !
? I*instruction*!I !

Implementations

A one-liner python implementation (uses recursion):

f=open(__file__.split(chr(92))[-1]).read();code=input();d=p=0;data=[1]*8;[exec({"!":"data[d]=int(not data[d]);d+=1;data.append(0)","I":"p+=1 if not data[d]else 0;d-=1"}.get(i,""))for i in code];p=0 if not data[d]else 1;exit()if p==1 else exec(f[f.index(chr(91),31):])