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.
QuineAvoiding("漢字", "") is the quine-avoiding constant languageQuineAvoiding("漢字",""), inspired by chinese characters. Its purpose is print "Chinese characters" in Chinese without allowing a quine.
If the program is exactly "漢字" (without the quotes), the output is "漢字". Otherwise, the output is "". However unicode strings are not allowed, instead the input must be in the form of strokes, (such as those described by an SVG file.)
Example
Not allowed.
Interpreter
python
import base64, sys
B = base64.b64decode(open('hanzi.b64').read())
bits = ''.join(f'{b:08b}' for b in B); pos = 0
def rd(n):
global pos; v = int(bits[pos:pos+n], 2); pos += n; return v
def catmull(P, n=14):
if len(P) == 2:
return [(P[0][0]+(P[1][0]-P[0][0])*i/(n-1), P[0][1]+(P[1][1]-P[0][1])*i/(n-1)) for i in range(n)]
Q = [(2*P[0][0]-P[1][0], 2*P[0][1]-P[1][1])] + P + [(2*P[-1][0]-P[-2][0], 2*P[-1][1]-P[-2][1])]
out = []
for i in range(len(Q)-3):
a, b, c, d = Q[i:i+4]
for j in range(n):
t = j/(n-1)
out.append(tuple(0.5*(2*b[k] + (c[k]-a[k])*t + (2*a[k]-5*b[k]+4*c[k]-d[k])*t*t
+ (-a[k]+3*b[k]-3*c[k]+d[k])*t**3) for k in (0, 1)))
return out
def ribbon(P, W):
C = catmull(P); m = len(C)-1; L = []; R = []
for i, (x, y) in enumerate(C):
t = i/m * (len(W)-1); j = min(int(t), len(W)-2); f = t-j
w = W[j] + (W[j+1]-W[j])*f
px, py = C[max(0, i-1)]; qx, qy = C[min(m, i+1)]
dx, dy = qx-px, qy-py; n = (dx*dx+dy*dy)**.5 or 1
nx, ny = -dy/n*w, dx/n*w
L.append((x+nx, y+ny)); R.append((x-nx, y-ny))
pts = L + R[::-1]
return 'M' + 'L'.join(f'{x:.1f} {y:.1f}' for x, y in pts) + 'Z'
# per-character placement: user = origin + (raster - 24) * scale/464
PLACE = [(758.0-24*542.0/464, 16.9-24*514.0/464, 542.0/464),
(1396.0-24*508.0/464, -5.1-24*572.0/464, 508.0/464)]
paths = []
for ci in range(2):
ox, oy, s = PLACE[ci]
for _ in range(rd(5)):
np_ = rd(3)
P = [((rd(7)*4)*s+ox, (rd(7)*4)*s+oy) for _ in range(np_)]
W = [rd(3)*3.5*s for _ in range(4)]
paths.append(ribbon(P, W))
body = ''.join(f'<path d="{d}"/>' for d in paths)
open('strokes.svg', 'w').write(
f'<svg xmlns="http://www.w3.org/2000/svg" viewBox="423 -32.1 1806 625.1" fill="#990000">{body}</svg>')
print('strokes:', len(paths))