《螺中宇宙》系列 · 互动小游戏The Universe in a Shell · an interactive game

格子魔法Cell Magic

简单的规则,涌现出复杂的世界Simple rules, emerging into complex worlds

现在格子铺满了一整片。点格子画出小生命,或者挑一个小生物放上去,再按开始。每个格子数一数身边的 8 个邻居,照着四条规则决定下一刻亮还是灭。玩熟了,去闯关挑战试试身手! Now the cells fill a whole sheet. Tap to draw, or drop in a little creature, then press Play. Each cell counts its 8 neighbours and follows four simple rules. Then try the Challenges!
第 0 代 · 活着 0 个格子

从最简单的开始:只有一排格子。横着的一排是空间;每算一次,就往下织一行,竖着的就是时间——一行一行织下去,就织成了一张时空织锦。每个格子看左边、自己、右边,再查答案卡:答案亮,下一行这里就亮。三个格子只有 8 种样子,所以有 8 张卡;每一种改法都是一条新规则,一共 256 条。再点一点第一排换个开头,看看花纹会怎么变! Start with the simplest: a single row. Across is space; each step weaves one more row below, so down is time — row by row, a tapestry of space and time. Each cell looks left, at itself and right, then checks the answer cards. Change an answer and you have a new rule — 256 in all. Then tap the first row to try a different start.
这是第90号规则 (256 条里的一条)Rule 90 of 256

花纹 = 初值(第一排):开头亮哪些格子 + 规则:答案卡Pattern = starting cells (the first row) + rule (the answer cards)

初值(第一排)Starting cells或点画板最上面一行,自己摆 规则Rule
每个格子有 8 种颜色,像一只转盘一格一格往下转。只有当身边有足够多的邻居已经是“下一种颜色”时,它才跟着转一格。一开始乱糟糟的……耐心等一等,看看会出现什么?点一点画面,可以撒一把乱七八糟的颜色! Eight colours turn like a dial. A cell moves on only when enough neighbours already show the next colour. Wait and watch — then tap to stir it up.
已经转了 0 步
每个格子是一个小沙堆,最多只能堆 3 粒沙。一旦堆到 4 粒,它就会塌:把 4 粒沙分给上下左右 4 个邻居,一家 1 粒。邻居多了一粒,也可能跟着塌——一场“雪崩”就这样传开了!点一点画面撒沙子,或者让沙子从中间一直落下,看看会长出什么。 Each cell is a tiny sand pile that can hold 3 grains. At 4 it topples, giving one grain to each of its 4 neighbours — which may topple too. Tap to drop sand, or pour it into the middle and watch.
一共 0 粒沙 · 刚才这场雪崩:0 次塌落 · 最大一场:0
走出格子:这里没有格子,只有一群自由飞的小鸟。每只鸟只看身边的几位邻居,守三条规则——别撞上、一起飞、靠过去。没有领头鸟,却飞出了整齐的鸟群——就像黄昏天空里的椋鸟。用手指当老鹰去吓吓它们,或者撒一把食物看看! Out of the grid: no cells here, just birds flying free. Each one watches a few neighbours and keeps three rules — don’t bump, fly the same way, stay close. No leader, yet a flock appears — like starlings at dusk. Be a hawk and scare them, or scatter some food!
0 只鸟 · 没有领头鸟,每只只看身边的邻居
格子不只会画画,还会算数!在这里,只认四条规则的格子被搭成了逻辑门,又被搭成了一整台电脑。先放大看看一台真正在格子里运转的图灵机;想知道它是怎么搭的,再去拨一拨逻辑门的开关。 Cells can compute! Here, cells that only know the four rules are built into logic gates — and into a whole computer. Zoom into a real Turing machine running inside the grid — then flip the logic-gate switches to see how it is built.
图灵机:格子里的一台电脑A Turing machine made of cells

生命游戏里的第一台电脑The first computer in the Game of Life

这张图可不是画出来的——它是一台正在运行的电脑!把它放大:手机和 iPad 上用两根手指撑开,电脑上滚动鼠标滚轮。一直放大到能看清一个个小格子,你会看到成千上万架小飞船排着队,在程序和纸带之间来回送信。

放大以后找一找:哪里有正在“吐”飞船的飞船工厂?哪里有守在路口的小吃货?不知道从哪里看起,就点导览按钮,一站一站地逛。

它的来历也很传奇:2000 年,保罗·伦德尔(Paul Rendell)用自己在 1980 年代设计的一个个小零件,拼出了生命游戏里第一台完整运转的图灵机,一共 1714 × 1647 格。它按照程序一步一步地运行:每走一步要 11040 代,走完 16 步就停机。当年在他的电脑上,这段程序要跑一个多小时;现在,你几分钟就能看完。

This picture is not drawn — it is a computer, running right now! Zoom in: pinch with two fingers, or scroll your mouse wheel, until you can see the cells — thousands of gliders queueing up to carry messages between the program and the tape. Can you find a glider gun firing? An eater guarding a crossing? In 2000 Paul Rendell assembled it from little parts he had designed in the 1980s: the first fully working Turing machine in the Game of Life. On his computer the run took over an hour — here, a few minutes.

图灵机 · 生命游戏里的一台电脑A Turing machine inside the Game of Life

拖动移动 · 滚轮或双指缩放 · 双击放大Drag to move · scroll or pinch to zoom
🔍放大看看,里面在忙什么?Zoom in — what is going on inside?双指撑开 · 滚动滚轮 · 或点 +

图案:Paul Rendell,A Turing Machine in Conway’s Game of Life(2000 年 3 月 2 日),rendell-attic.org/gol/tm.htm;同见开源软件 Golly 的图案合集(GPL)。我们只在轨迹输出的飞行路线上加了吞噬者,其余一格未改。Pattern by Paul Rendell (2 March 2000), rendell-attic.org/gol/tm.htm; also in the Golly pattern collection (GPL). Our only change: eaters on the trace-output paths.

逻辑门:电脑是怎么搭起来的Logic gates — how the computer is built

想知道上面那台电脑是怎么一块块搭起来的?它最小的零件就是逻辑门。选一个门,拨一拨开关,看飞船怎么“做决定”。Curious how that computer is built? Its smallest parts are logic gates. Pick one and flip the switches to watch the gliders decide.

第 0 代 · 每个格子都在按四条规则变化
一团黏菌没有大脑,却会在食物之间连出又省又稳的网。这里有几万个小小的黏菌粒子:每个只闻一闻前方三个方向,往气味最浓的地方爬,一边爬一边留下气味。点一点画面放一份燕麦,看它们自己织出一张网——再换一个镜头看看:这张网,像不像城市、大脑,甚至整个宇宙? A slime mould has no brain, yet it links its food with networks that are both thrifty and sturdy. Here, tens of thousands of tiny particles each sniff three directions ahead, crawl toward the strongest scent and leave scent behind. Tap to drop an oat flake and watch a web weave itself — then switch the lens: does it look like a city, a brain, even the universe?
 
从一个三角形开始,把每条边分成三段,在中间那段上长出一个小尖角。然后——对每一条新的边,再做一次同样的事。一直做下去,就长出了科赫雪花:它的边越来越长,可以长到无穷长,围住的面积却始终有限。 Start with a triangle. Cut each side into three and grow a small spike on the middle third. Then do the same to every new side — again and again. This is the Koch snowflake: its edge grows without end, yet the area it encloses stays finite.
 
一根树枝,分成两根小一点的树枝;每一根小树枝,再分成两根更小的……同一条“分叉”的规则用十几次,就长出了一整棵树。把两边调得不一样——一边长、一边短,一边直、一边弯——树枝就会卷起来,像蕨菜的嫩芽,也像螺壳。 One branch splits into two smaller ones; each of those splits again… Use one “fork” rule a dozen times and a whole tree appears. Make the two sides different — one long, one short, one straight, one bent — and the branches curl up like a fern’s fiddlehead, or a seashell.
 
取一个数 c,从 0 开始,一遍遍算 z → z² + c。有的 c 会让 z 越跑越远,有的 c 让 z 永远被困在附近——所有被困住的 c,就组成了曼德博集。它的边上螺旋套着螺旋,放得再大,也看不到尽头;而且每一个螺旋都不一样,像一枚枚独特的海螺。拖动、滚轮或双指来放大,或者跟着下面的寻宝点去看看。 Pick a number c. Starting from 0, compute z → z² + c over and over. For some c, z flies away; for others it stays trapped forever — the trapped ones form the Mandelbrot set. Along its edge, spirals nest inside spirals with no end in sight, and no two are alike — like seashells, each its own. Drag, scroll or pinch to zoom, or follow a treasure point below.
 
曼德博集其实是一张地图:上面的每一个点 c,都对应着一朵茱莉亚集。在左上角的小地图上点一点、拖一拖,就会长出那一点的茱莉亚集——点在曼德博集的螺旋附近,长出来的也是螺旋。每一个点,都是一枚只属于你的海螺。 The Mandelbrot set is really a map: every point c on it belongs to a Julia set. Tap or drag on the little map to grow the Julia set of that point — choose a spot near one of its spirals and you get spirals too. Every point is a seashell that is yours alone.
 
佛经里说,天神因陀罗的宫殿上挂着一张无边的网,每个网结上缀着一颗明珠——每一颗珠子里,都映着其他所有的珠子,影子里还有影子,没有尽头。数学家在圆里找到了这张网:四个圆两两配对,每一对用一个“圆变圆”的魔法,把圆外面的整个世界塞进对面的圆里。反复做下去,圆里套圆,就长出一串串越来越小的珍珠。拖动滑杆,让珍珠变小、扭一扭;也可以看看下面几幅有名的“珍珠图”。 An old Buddhist story tells of the god Indra’s palace, hung with an endless net with a jewel at every knot — and in each jewel, all the other jewels are reflected, reflections within reflections, without end. Mathematicians found this net among circles: four circles in two pairs, each pair using a “circle-to-circle” spell to squeeze the whole world outside one circle into its partner. Repeat, and circles nest in circles: strings of ever smaller pearls. Drag the sliders to shrink or twist the pearls, or look at some famous pearl pictures below.
 

简单的规则,一格一格地算下去,就能长出复杂的世界。

Simple rules, worked out cell by cell, can grow a whole complex world.

格子魔法是什么?What is Cell Magic?

把世界切成一个个小格子。每个格子只看身边的邻居,按同一条简单的规则,决定下一刻变成什么样子。没有总指挥,也没有设计图——会飞的小生物、三角形套三角形、旋转的螺旋、一塌一大片的沙堆,都是格子们自己“算”出来的。科学家把这样的格子世界叫作元胞自动机。

Cut the world into little cells. Each one looks only at its neighbours and follows the same simple rule to decide what it becomes next. There is no conductor and no blueprint — flying creatures, triangles inside triangles, spinning spirals and toppling sandpiles are all worked out by the cells themselves. Scientists call such cell worlds cellular automata.

两条路线Two journeys

上面一排是从格子到计算:时空织锦只有一排格子,生命游戏铺满一整片,格子电脑里,格子竟然搭成了一台会运行程序的机器。下面一排是从格子到生命:沙堆里的雪崩、化学反应和黏菌里的螺旋,最后走出格子,变成天空中的椋鸟群。两条路线讲的是同一件事:简单的规则,涌现出复杂的世界。

The top row runs from cells to computing: a single row in the Spacetime Tapestry, a whole sheet in the Game of Life, then cells built into a machine that runs a program. The bottom row runs from cells to life: avalanches in a sandpile, spirals in chemistry and slime moulds, and finally out of the grid into a flock of starlings. Both tell the same story: simple rules, emerging into complex worlds.

什么是“涌现”?What is emergence?

一个格子、一粒沙、一只鸟,都只懂一两条简单的规则,谁也不知道整体是什么样子。可是当成千上万个它们一起按规则行动,就会冒出谁也没有设计过的东西:会飞的小生物、旋转的螺旋、曼陀罗一样的沙堆、整齐的鸟群——这就叫涌现。蚁群、城市、大脑,甚至生命本身,可能都是这样涌现出来的。

A single cell, grain or bird knows only a rule or two and has no idea what the whole looks like. Yet when thousands of them follow their rules together, something no one designed appears — flying creatures, spinning spirals, mandala-like sandpiles, orderly flocks. This is called emergence. Ant colonies, cities, brains, perhaps life itself, may emerge the same way.

它们从哪里来?Where do they come from?

  • 元胞自动机:1940 年代,数学家冯·诺依曼和乌拉姆最早提出。Cellular automata — first proposed by John von Neumann and Stanislaw Ulam in the 1940s.
  • 生命游戏:英国数学家约翰·康威,1970 年。奇妙生物馆里的结构,是世界各地的爱好者几十年来一个个找出来的。Game of Life — John Conway, 1970. The creatures in the gallery were found one by one by enthusiasts around the world over decades.
  • 时空织锦:斯蒂芬·沃尔夫勒姆从 1980 年代开始研究这 256 条规则,写进了《一种新科学》(2002)。Spacetime Tapestry — Stephen Wolfram studied these 256 rules from the 1980s and wrote them into A New Kind of Science (2002).
  • 彩色漩涡:美国数学家格里菲思(David Griffeath)和同事们在 1990 年前后研究的“循环元胞自动机”。Spirals — the cyclic cellular automaton studied by David Griffeath and colleagues around 1990.
  • 椋鸟飞翔:计算机图形学家克雷格·雷诺兹(Craig Reynolds)1986 年提出的 Boids 模型。Flocking — the Boids model by computer-graphics researcher Craig Reynolds, 1986.
  • 沙中之花:物理学家巴克、汤超和维森菲尔德,1987 年。Sandpile — physicists Per Bak, Chao Tang and Kurt Wiesenfeld, 1987.

展览 · 螺中宇宙,数学之美 The Universe in a Shell · The Beauty of Mathematics

by 林辰芳 2026

背景音乐The music

每种配色都有一首自己的背景音乐,而且都是格子在“演奏”:赛博是《微光》,一块生命游戏小棋盘当音序器,滑翔机飞到哪里就弹哪个音;几何是《规则九十 · 木琴》,木琴一代代读出第 90 号规则长出的三角形;手绘是《沙堆八音盒》,小沙堆每塌一次就敲响一颗音。飞进椋鸟飞翔,会换成《椋鸟的呼吸》:音乐一直在“听”鸟群——一层延绵的和声随着鸟群一呼一吸,大家飞得越齐越舒展,和声就越饱满明亮;鸟群转弯,和声像浪一样涌起;竖琴的旋律跟着鸟群的高度走,飞高往上,飞低往下;老鹰一来,一串音从高处倾泻下来。音乐都是在你的设备上现场合成的,右上角的 ♪ 可以开关。

Each colour theme has its own music, and the cells play it: in Cyber, Glimmer, a little Game of Life board is the sequencer; in Geometric a marimba reads the triangles of Rule 90; in Hand-drawn a small sandpile rings a music-box note at every topple. All of it is synthesized live on your device; the ♪ button turns it on and off.