guest@6admin.io:~$

man sheep.exe

$ man sheep.exe
No manual entry for sheep.exe
$

That is correct, there is none, and this post will not serve as a manual page either. Someone asked me to explain the maintenance page, I started answering, then stopped when I realized that walking through all of it would amount to taking the toy apart in front of someone who has not had time to touch it yet. What follows gives the entry points, not the exits.

Start at the bottom of the page

There is a number in the status bar. It says 57 days while you read this sentence, and unlike almost everything else on this site it tells no story, since it is exactly what git log --reverse would answer if you cloned the repository.

Click it.

I will not say what happens, otherwise I might as well spoil everything right away. Just know that the same number then starts counting from 452822400, i.e. May 8, 1984, which should put you on a literary trail whose originality I will not claim. The counter reads forty-two years as I write these lines. The answer without the question. The second layer is better hidden and far less interesting: it merely happens to be the site’s production date. I leave the sobriety of the gesture to your judgment.

The background is not an image

What moves behind the text is Conway’s game of life, running for real, cell by cell. Four rules, not one more: a cell lives, dies or is born according to the number of neighbors around it. With those four rules one assembles logic gates, and with those gates a complete computer inside the game itself, which is not a figure of speech since people have actually done it, pattern by pattern, and I would rather not know how many weekends it cost them.

If you open your browser console, the grid answers. It will tell you how many cells are alive, what dimensions it occupies, and where the densest cluster on screen sits. Nothing is obfuscated: window.LifeGame and window.SheepFlock will surface the rest, and you can then subscribe to the events they emit, which brings us to the next point.

The journal only lies half the time

The journal tab scrolls log lines. Some are pure decoration, written in advance and drawn at random. The others absolutely are not. The latter describe events that just happened in the simulation, to the cell, and nothing typographically distinguishes them from the former, which was probably a bad design decision but I stand by the result.

Sorting is done by eye, provided you watch the screen at the same time as the text. When a line announces that a sheep just grazed seven cells, go check that seven are missing. When another announces a decaying carcass and then a number of cells returned to the soil, go check that the grid lit up by as much.

The sheep has a Windows extension and it is not an accident

The whole vocabulary of the site is strict Unix, systemd[1], journald, ps aux, and then there is sheep.exe. The cheap joke fits in one line and you have already made it mentally, thank you. The real reason is called eSheep, a 1995 piece of software whose sheep walked along the edges of windows, and which itself descended from short animated films by Tatsutoshi Nomura broadcast around midnight on Fuji Television. A nocturnal cartoon sheep, then, converted into software sold for a few thousand yen, which sums up the mid-nineties rather well.

It is repeated everywhere that it died with Windows XP. That is false and funnier than that, since this 16-bit binary survived every 32-bit edition, and only the switch to 64 bits, taking the whole subsystem with it, finally killed it. Which explains the first line of the boot messages on the maintenance page, where the detected architecture ends with a number that is not there to look pretty. The original sheep died of 64 bits. Mine boots on it.

Three authors share a banner

Once the hidden mode is triggered, a text scrolls across the top of the screen. Orwell supplies what is expected of him and no one will be surprised, but I had to look for reinforcements. Philip K. Dick therefore comes to doubt that reality exists, and Asimov forbids robots from letting a human come to harm before calling violence the last refuge of the incompetent, which lands rather badly given what happens to the flock half a page below.

Three men who probably did not plan to end up on a scrolling banner above a pixel sheep. The file that gathers them is a plain JSON island in the page, and if you want to know who said what, you do not even need to download anything.

What goes in must come out

Sheep do not merely walk on the grid. They spot dense clusters, stop there, and graze the cells within a radius around their muzzle, which genuinely lowers the automaton’s population. Since a cycle that only loops halfway is of no interest, the rest was inevitable, and I leave it to you to imagine by what mechanism the cells return to the grid. Let us say the sheep must first digest, that the operation takes place at the exact spot where it stands, and that the result relights dead cells.

Cells, sheep, digestion, deposit, cells. A closed metabolism, which is already satisfying, except that I had gotten carried away and a fed sheep is also advantaged when pairing. The demography of the flock therefore depends on the state of the grid it grazes, a famine on the automaton eventually showing up in sheep natality. That consequence I had not foreseen, I discovered it watching the journal scroll, and I kept it because it was too beautiful to fix.

Three functions carry names explicit enough for you to reconstruct the loop without my help. Look for the one that kills cells, the one that relights them, and the boolean flag that conditions the second on the first.

Death is fertilizer too

The sheep grazes, digests, deposits: the metabolism already ran both ways. It was missing the most obvious exit, the one by which everything ends. Every sheep now carries a nutrition gauge: it fills with each bite, empties with time, and when it stays at zero for eight seconds, the sheep dies of hunger. No script, no staging: the same death as war, applied to a sheep that simply did not find grass.

Old age is a matter of genes, literally: the genome went from three genes to four: curiosity, laziness, sociability, longevity, with crossover and mutation like the rest. Longevity multiplies the age at which death becomes possible, but it does not set a countdown: past that threshold, every second plays a roll whose probability rises with age. One sheep may die old, another survive beyond reason, and nobody wrote that anywhere.

Every death leaves a carcass, a small heap of pixels that decomposes for sixteen seconds. Its biomass depends on what the sheep ate during its life and on the state of its gauge at the moment of death: a full sheep returns more cells than a starving one. Decomposition pours them back one by one into the grid, at the exact spot where the body fell, and nothing is lost: mass only leaves the carcass if a cell is really relit. A well-fed adult returns fourteen to eighteen cells. A sheep that ate nothing returns far fewer. The carnage of the next section therefore takes part in the cycle: laser strike victims also leave something to regreen the meadow.

I had written the loop without checking the arithmetic, though. The first version returned eight cells per carcass, while three sheep demand forty-five living cells to avoid crying famine: the flock went round in circles, was born, starved, respawned, started again. A headless probe showed me this, a cycle measured rather than guessed: sixty-six cells before the war, one hundred and ninety-six after the five carcasses decomposed. I doubled the yield and the loop started turning the right way.

One safety valve remains: if the flock dies out entirely in peacetime, two fresh sheep are reborn a few seconds later. The game never stops for lack of players. And if you asked your system to reduce motion, death is paused with the rest: no aging, no famine, no carcasses. A motionless sheep is an immortal sheep, which is one way of looking at things.

And then it degenerates

Make enough sheep and the population crosses a threshold. What follows is brief, violent and perfectly cartoonish: the survivor takes off and exits the screen along a trajectory I spent an unreasonable amount of time tuning, with an approach, loops at the edge, a heading reversal and an accelerated crossing.

Those who wore out a mouse on a certain game of armed worms will have recognized the curve before the end of the paragraph. For the others, the name of the game is written in black and white in a CSS comment, which is to my knowledge the only reference on this site that does not come from a book.

The threshold that triggers all this was for a long time purely geometric, a simple matter of sheep per available pixel, and therefore told rigorously nothing. It now counts three. Density remains, since a full screen must eventually overflow, but overgrazing and famine have joined it, that is to say the moment when the flock grazes faster than the grid regenerates, then the moment when there is frankly nothing left to graze.

Famine has gained a second effect since death arrived: it also kills à la carte, sheep by sheep, and the carcasses it leaves can be enough to reverse the trend before war is declared. When they are not enough, the flock is mowed down by laser, and what remains of it feeds the grid for the next generation.

Two of these three causes therefore fall under the sheep’s responsibility, which retrospectively gives their carnage some meaning. Nothing prevents you from provoking them separately to see which arrives first, and I note in passing that Asimov was right all along, which I am not entirely over.

The rest is scattered

Not here, in any case. The repository is public, I write my commit messages as if someone were going to read them one day, a hypothesis whose optimism I measure, and the changelog tells the order in which the layers piled up, which makes it fairly visible that none of them was planned.

I will not tell you which file to look in for what. What this post lacks is scattered almost everywhere, without an overall plan, sometimes in places no one would willingly look. Code comments are verbose out of vice rather than method, and variable names occasionally drop the mask.

One last thing, and I leave you

On the grid, from time to time, five cells start crossing the screen diagonally without ever deforming. It is called a glider, it is the smallest structure in the game of life capable of moving on its own, and someone once proposed making it the flag of a certain community that did not have one. That someone also keeps the slang dictionary of said community, which gave him a legitimacy hard to dispute and which he did not fail to remind everyone himself.

You have had it in front of you since the beginning, by the way. Not in the background, where it merely passes by. In the cursor blinking at the end of the prompt.

$ ps aux | grep sheep
sheep     421  0.0  0.1  grazing  conway_cells
$