We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Talk:Burn in Hell

From Esolang
Jump to navigation Jump to search

Ive seen these numbers once before --Yayimhere2(school) (talk) 14:36, 3 August 2026 (UTC)

I really like Pocket and so i figured i could make a new page to give them support. Miui (talk) 14:40, 3 August 2026 (UTC)
Aren't these numbers also from the thing we worked on? --Yayimhere2(school) (talk) 14:53, 3 August 2026 (UTC)
The reality is that it is a ternary rule 110, but the burnlike paradigm is excellent for interpreting it as something TC. But I'm glad you recognized it. It is also a good way to manipulate memory when playing Super Mario Bros.
# TERNARY LINEAR REVERSIBLE CA -- efficient version.
# next[i] = (prev[i] + left[i] + right[i]) mod 3, built by SEQUENTIAL
# modular accumulation (copy P, add L with correction, add R with
# correction) instead of a 27-way truth table -- since the rule is
# linear, no combinatorial AND-gate is needed at all. Collapses from
# 6377 cheats to well under 6000. set/inc/dec/rig/rie only.
S,P,NX,INIT = 0x0550, 0x0560, 0x0570, 0x0581
G=15
SEED_S=[0,0,0,0,0,0,0,1,0,0,0,0,0,0,0]
SEED_P=[0]*15
prog=[]
for i in range(G): prog += [('rie',INIT,0,f'si{i}g'),('set',S+i,SEED_S[i],f'si{i}')]
for i in range(G): prog += [('rie',INIT,0,f'pi{i}g'),('set',P+i,SEED_P[i],f'pi{i}')]
prog += [('rie',INIT,0,'idg'),('set',INIT,1,'id')]

for i in range(G):
    L,R=(i-1)%G,(i+1)%G
    # NX[i] := P[i]  (3-way copy)
    for v in range(3): prog += [('rie',P+i,v,f'cpP{i}_{v}g'),('set',NX+i,v,f'cpP{i}_{v}')]
    # NX[i] += S[L], gated on S[L]'s value (only 3 cases, not 9)
    for v in (1,2):
        prog += [('rie',S+L,v,f'addL{i}_{v}g'),('inc',NX+i,v,f'addL{i}_{v}')]
    prog += [('rig',NX+i,2,f'modL{i}g'),('dec',NX+i,3,f'modL{i}')]
    # NX[i] += S[R], gated on S[R]'s value
    for v in (1,2):
        prog += [('rie',S+R,v,f'addR{i}_{v}g'),('inc',NX+i,v,f'addR{i}_{v}')]
    prog += [('rig',NX+i,2,f'modR{i}g'),('dec',NX+i,3,f'modR{i}')]

# P := S ; S := NX  (3-way copies)
for i in range(G):
    for v in range(3): prog += [('rie',S+i,v,f'pc{i}_{v}g'),('set',P+i,v,f'pc{i}_{v}')]
for i in range(G):
    for v in range(3): prog += [('rie',NX+i,v,f'sc{i}_{v}g'),('set',S+i,v,f'sc{i}_{v}')]

# corruption: same channels as before
for i in range(G):
    prog += [('rie',S+i,1,f'rain_g{i}'),('inc',0x0200+4*i,1,f'rain_y{i}')]
for i in range(G):
    prog += [('rie',S+i,2,f'flick_g{i}'),('inc',0x0202+4*i,1,f'flick_a{i}')]

T={'set':'1','inc':'2','dec':'3','rie':'4','rne':'5','ril':'6','rig':'7'}
A=[]
for i,(op,a,v,d) in enumerate(prog):
    A += [f'cheat{i}_address = "{a}"',f'cheat{i}_address_bit_position = "0"',
          f'cheat{i}_big_endian = "false"',f'cheat{i}_cheat_type = "{T[op]}"',
          f'cheat{i}_code = ""',f'cheat{i}_desc = "{d}"',
          f'cheat{i}_enable = "true"',f'cheat{i}_handler = "1"',
          f'cheat{i}_memory_search_size = "3"',
          f'cheat{i}_repeat_add_to_address = "1"',f'cheat{i}_repeat_add_to_value = "0"',
          f'cheat{i}_repeat_count = "1"',f'cheat{i}_rumble_port = "0"',
          f'cheat{i}_rumble_primary_duration = "0"',f'cheat{i}_rumble_primary_strength = "0"',
          f'cheat{i}_rumble_secondary_duration = "0"',f'cheat{i}_rumble_secondary_strength = "0"',
          f'cheat{i}_rumble_type = "0"',f'cheat{i}_rumble_value = "0"',
          f'cheat{i}_value = "{v}"']
A.append(f'cheats = "{len(prog)}"')
open('multicart_ternary_reversible.cht','w').write('\n'.join(A))
print(f"{len(prog)} cheats -> multicart_ternary_reversible.cht (under 6000: {len(prog)<6000})")

def cheat_pass(mem):
    skip=False
    for op,a,v,_ in prog:
        if skip: skip=False; continue
        if op=='set': mem[a]=v
        elif op=='inc': mem[a]=(mem[a]+v)&0xFF
        elif op=='dec': mem[a]=(mem[a]-v)&0xFF
        elif op=='rie': skip=(mem[a]!=v)
        elif op=='rig': skip=not(mem[a]>v)
mem=[0]*0x600
s_ref=SEED_S[:]; p_ref=SEED_P[:]
ok=True
for f in range(400):
    cheat_pass(mem)
    nxt=[(p_ref[i]+s_ref[(i-1)%G]+s_ref[(i+1)%G])%3 for i in range(G)]
    p_ref,s_ref = s_ref, nxt
    if mem[S:S+G]!=s_ref or mem[P:P+G]!=p_ref:
        ok=False; print(f"MISMATCH at gen {f}: got S={mem[S:S+G]} want {s_ref}"); break
print("efficient ternary linear reversible CA matches reference for 400 generations:", ok)

def fwd(s,p,n):
    for _ in range(n):
        nxt=[(p[i]+s[(i-1)%G]+s[(i+1)%G])%3 for i in range(G)]
        p,s=s,nxt
    return s,p
def back(s,p,n):
    for _ in range(n):
        prevS = p[:]
        prevP = [(s[i]-p[(i-1)%G]-p[(i+1)%G])%3 for i in range(G)]
        s,p = prevS, prevP
    return s,p
s0,p0 = SEED_S[:], SEED_P[:]
s10,p10 = fwd(s0,p0,10)
s_back,p_back = back(s10,p10,10)
print("reversibility preserved:", s_back==s0 and p_back==p0)

mem2=[0]*0x600; hist=[SEED_S[:]]
for f in range(24): cheat_pass(mem2); hist.append(mem2[S:S+G])
for row in hist: print(''.join(str(v) for v in row))
Fun!!! --Yayimhere2(school) (talk) 14:56, 3 August 2026 (UTC)