Parity

From Esolang
Jump to navigation Jump to search

Parity was created by User:imcute and is called this name due to its only 2 instruction list and its way of doing instructions
an even number means to add 1 to the place of the number divided by 2
an odd number means jump to the number in the place of the number divided by 2 without the 0.5
this language has 2 dialects:list-starts-at-0 dialect and list-starts-at-1-dialect due to technical restrictions
a count to infinity program in dialect 0 would be 4 7 0 0 while in dialect 1 it would be 6 9 0 1
the turing completeness of this is questionable due to it not having a conditional jump
implementations:
python

LOOP_CHECK=1000

with open("code","r")as a:
	ram=list(map(int,a.read().split()))
i=0
try:
	while True:
		p=0+ram[i]
		if p%2==0:
			ram[p//2]+=1
			i+=1
		else:
			i=ram[p//2]
		print(" ".join(map(str,ram)))
		LOOP_CHECK-=1;
		if LOOP_CHECK<=0:
			raise ZeroDivisionError
except IndexError:
	print("result:")
	print(" ".join(map(str,ram)))
except ZeroDivisionError:
	print("Oops!Code too long to run.If this is intentional,make line one to something supra big")


snap https://snap.berkeley.edu/snap/snap.html#present:Username=18001767679&ProjectName=slate%20assembler (its called slate assembler cuz slate_technoligies wanted this in snap)