Xcode is a Redcode implementation for JS1k to play CoreWars, where two programs ("warriors") battle to the death. Click the core to restart the fight.
for(_="=='RR#'Q[2]addMOV=[))y((A[4]y+C),'#',0\\n 4ADD ?A:h;JM)=>')Timeout(v(m,D,E.innerHTML=); textarea< rows=5 id=.length,B,C=A=>h=)( +([#@<]?) *(.+?.includes(i)?`<b style='background-color:#b`W> 0 1</>Y> 5 <5SUB #5#63 2JMP -4DAT 0 2</><pre id=P></pre>`;v+8e9)%8e3;yc[A)];x=BQ?C:A+C+(B?=-(BR<):0 u=,b,J=p=0A.value.replace(/^(...?)?( *;.*)?$/gm,(m,A,a,dJ||A&&(J=AREND?p=C:c[b++)]A|0|0])|p;_=DAT-1;=k?+i*A:(m=l+m*A),l+*A) ADD(1 SUB(-1 CMPh+=k?i==:l+''==m;DJN--(DQ?h):m)PA;JMNZ?h:A;k?=i:c[j)]...l];SLTh+=(k?i:l)<;SPLg.push(++h&&A;(P.onclick(n=a=h{g=o%2?d:f;h=g.shift( [A]=h i=x(h j=x(h k=BQ;l=i m=j eval)(i-1) h>=0&&SPL( P(g?--o?(n=seta,1&&[o,d,f]:'Time':o%2?'B!':'A!+c.map(([[A]],i(i%150?'':'+(d109'>`:f900'>`:'+A+'</b>.join('})(clearn),c=Arra8e3).fill(o=8e4).map=>h'_']),fu(Y,e=100+~~(Math.random()*7800+e],du(W,0)]()";G=/[-QR]/.exec(_);)with(_.split(G))_=join(shift());eval(_)
Zm9yKF89Ij09J1JSIydRWzJdH2FkZB5NT1YdPVscKSkbeSgaKEEZWzRdGHkZK0MpGBcsJyMnLDAWXFxuFSA0FUFERCAUP0E6aDtKTRMpPT4SJykRVGltZW91dCgQdigPbRgOLEQsRQwuaW5uZXJIVE1MPQspOwl0ZXh0YXJlYQg8CCByb3dzPTUgaWQ9By5sZW5ndGgGLEIsQwU9QT0+BARoPQMpKCArKFsjQDxdPykgKiguKz8CLmluY2x1ZGVzKGkpP2A8YiBzdHlsZT0nYmFja2dyb3VuZC1jb2xv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bChfKQ==
// This is what I had at the end, before minification
// A post follows soon to explain some of the bits
f(b);
function f(
b,
A, B, C, D, E,
P, W, Y,
a, c, d, e, f,
g, h, i, j, k,
l, m, n, u, v,
x, y, o, p, q,
) {
b.innerHTML = `<textarea rows=5 id=W>MOV 0 1</textarea><textarea rows=5 id=Y>MOV 5 <5\nSUB #5 4\nADD #6 4\nADD 3 2\nJMP -4\nDAT 0 2</textarea><pre id=P></pre>`
;v = A => (A + 8e9) % 8e3
;y = A => c[v(A)]
;x = (A, B, C) => B == '#' ? C : A + C + (B ? y(A + C)[4] = v(y(A + C)[4] - (B == '<')) : 0)
;u = (A, b, q = p = 0) => A.value.replace(/^(...)( +([#@<]?) *(.+?)( +([#@<]?) *(.+?))?)?( *;.*)?$/gm, (m, A, a, B, C, d, D, E) => q || A && (q = A == 'END') ? p = C : c[v(b++)] = [A, B, C | 0, D, E | 0]) | p
;_ = DAT = A => h = -1
;add = A => m[4] = v(k ? m[4] + i * A : (m[2] = v(l[2] + m[2] * A), l[4] + m[4] * A))
;ADD = A => add(1)
;SUB = A => add(-1)
;CMP = A => h += k ? i == m[4] : l + '' == m
;DJN = A => h = --(D == '#' ? y(h) : m)[4] ? A : h
;JMP = A => h = A
;JMN = A => h = m[4] ? A : h
;JMZ = A => h = m[4] ? h : A
;MOV = A => k ? m[4] = i : c[v(j)] = [...l]
;SLT = A => h += (k ? i : l[4]) < m[4]
;SPL = A => h = g.push(v(++h)) && A
;(P.onclick = A => h = (n = a = h = A => {
g = o % 2 ? d : f
;h = g.shift()
;[A, B, C, D, E] = y(h)
;i = x(h, B, C)
;j = x(h, D, E)
;k = B == '#'
;l = y(i)
;m = y(j)
;eval(A)(v(i - 1))
;h >= 0 && SPL()
;P.innerHTML =
(g.length ? --o ? (n = setTimeout(a, 1)) && [o, d.length, f.length] : 'Time' : o % 2 ? 'B!' : 'A!')
+ c.map(([[A]], i) =>
(i % 150 ? '' : '\n')
// +(d.includes(i)?`<b style='background-color:#109'>`:f.includes(i)?`<b style='background-color:#900'>`:'')+A[0][0]+'</b>'
+ (d.includes(i) ? `<b style='background-color:#109'>` : f.includes(i) ? `<b style='background-color:#900'>` : '') + A + '</b>'
).join('')
})(
clearTimeout(n)
, c = Array(8e3).fill(o = 8e4).map(A => h = ['_', '#', 0, '#', 0])
, f = [u(Y, e = 100 + ~~(Math.random() * 7800)) + e]
, d = [u(W, 0)]
))()
}