Enclosure

Enclosure

Draw edges, fence in area, and cut your opponent's fences. Every turn you get points for the area you hold. After 120 edges, the higher score wins.

New here? Learn the game in a few minutes, read the rules, or try the strategy guide. Running an event? Set up a tournament.

Puzzle of the day
Solve it

Grow

Each edge starts at one of your nodes and reaches up to 3 points in any direction. Blue opens with one edge, then everyone plays two per turn.

Cut

Touch one of your opponent's edges and it breaks. You can only break one at a time, and edges placed on the last turn are protected.

Enclose

Close a loop to fence in area. After every turn, both players add the area they hold to their score.

Play

Puzzles

Puzzle

Lessons

Strategy guide

How to play

Enclosure is a game for two players on a 19 by 19 grid of points. You grow a drawing of edges, fence in area, and cut your opponent's edges. After 120 edges, the player with more points wins.

The start

Blue and Red each begin with one edge on the middle row. Blue's runs from the left side, a10, to d10. Red's runs from the right side, s10, to p10.

The ends of your edges are your nodes. Every new edge starts at one of them.

Turns

Blue goes first and places one edge. After that, players take turns placing two edges each: Red two, Blue two, and so on. The game lasts exactly 120 edges, so Blue's final turn is a single edge. Each player places 60.

Placing an edge

Pick one of your nodes and draw an edge to any point at most 3 steps away across and at most 3 steps up or down. That's the 7 by 7 square around the node. Any angle is fine. The far end becomes a new node, or joins a node of yours already there.

Two limits apply to your own drawing:

  • You can't end an edge on the middle of one of your own edges.
  • An edge can't pass through one of your own nodes.

Apart from that, your edges may cross each other.

Breaking edges

If your new edge touches one of your opponent's edges, their edge breaks and disappears. Crossing it counts. So does just touching it: ending your edge on it, or on one of its nodes. Any of their nodes left with no edges disappears too.

Each edge can break only one enemy edge. If it would touch two or more, you can't place it. Running through a node where two enemy edges meet touches both, so that isn't allowed either.

New edges are protected for one turn. You can't break an edge your opponent placed on their previous turn. On this site new edges have a light center line, so you can tell which ones are safe for now.

Area and score

Your area is everything your edges fence in, measured exactly in grid squares. A triangle across half a square counts 0.5.

At the end of every turn, both players add their current area to their score. If you hold 18 and your opponent holds 10, then when a turn ends you gain 18 and they gain 10. Area keeps paying every turn you hold it, and stops paying the moment a break opens it up.

Scores update after edges 1, 3, 5, and so on up to 119, and once more after edge 120. That's 61 updates. When the game ends, the higher score wins. Equal scores are a draw.

Questions

What if some of my area sits inside other area of mine?
It counts once. A triangle inside your quadrilateral adds nothing beyond the quadrilateral.
Do loops made by my own edges crossing count?
Yes. Any region your edges fence in counts, wherever the corners are.
What if my area surrounds my opponent's?
You get your area as if they weren't there, and they get theirs as if you weren't there.
Can my drawing split into separate pieces?
Yes. If your opponent breaks the edge holding two parts together, both parts stay, and you can keep building from either one.
Does the edge of the board fence anything in?
No. Only your own edges enclose area.
Can a player lose every edge?
Not in normal play. The edges you placed on your last turn are protected while your opponent moves.
What if I have no legal edge?
It almost never happens. On this site your edge is skipped, and it still counts toward the 120.

Clocks

Games can be played with a clock. The tournament setting is 1 minute plus 15 seconds: your clock runs during your turn, and each time you finish a turn you gain 15 seconds. If your clock runs out, the rest of your turn is skipped, the edges you placed earlier in that turn lose their protection, and you get 15 seconds for your next turn. Running out of time doesn't lose the game on its own.

Notation on this site

Columns are a to s from left to right and rows are 1 to 19 from bottom to top. An edge is written as its two ends, like d10-f12. An x in the middle, like f12xh13, means it broke an enemy edge.

House rules on this site

Everything above is the standard game. When you start a game here you can also change a few things, for practice or for fun. Games with changed rules say so on the play screen, and their links carry the rules with them.

  • A 13 by 13 board, and fewer edges each, for quicker games.
  • A reach of 2 or 4 instead of 3.
  • Three or four players, each starting on a different side, or two teams of two. Teammates can't touch each other's edges, and a team's score is its players' scores added up.
  • No protection for new edges.
  • Border walls: the edge of the board counts as one of your walls. The largest open part of the board is the outside, and everything else your edges and the border close off counts.
  • Running out of time can skip just one edge instead of the rest of the turn.
  • Handicap edges: extra edges in a player's first turn.

This is an unofficial fan-made version of the game, built from the rules as shown in its reveal video.

Analysis board

Play moves for either side, or switch to Edit to set up a position.

Tournament

Double elimination, the way the Strategy Jam ran: each round, players without a loss play each other and players with one loss play each other. Two losses and you're out. Play games on this screen, or anywhere else and record the result here.

You

Against the computer

Achievements

Your games

    Backup

    Profiles live in this browser. Save a copy to move them to another device.

    How this site works

    The whole thing runs in your browser: plain HTML, CSS and JavaScript, with no server of its own. Here is how the trickier parts work.

    Measuring area exactly

    Every edge joins two grid points, so all the contact tests use whole numbers and are exact. Area is harder, because a player's own edges can cross. The site splits every edge at its crossings, giving a flat map of corners and pieces. Walking around each face of that map with the shoelace formula gives its area. Faces that wind one way are fenced in; the one outer face winds the other way. If one of your pieces sits inside another of your pens, it's only counted once.

    The tests check this against a second method that shares no code with it: cut the board into thin vertical slabs at every corner and crossing, fill in from the outside, and add up the trapezoids that the fill never reaches.

    Checking the rules

    The rules engine is tested against a second, deliberately simple version written straight from the rule text. Thousands of random games, including every house-rule variant, compare the two on every candidate edge.

    The computer player

    It plans a whole turn at once. It ranks first edges by what they do right away and what they set up, tries the best second edges for each, and scores the result. The score adds the points gap, the area each side holds, what the opponent could break on their very next turn, and how exposed each cell is: a wall close to enemy nodes is more likely to go, and a cell is lost if any of its outside walls goes.

    The levels were tuned with computer-against-computer matches. In 40-game matches, Hard beat Medium 30 to 10 and Medium beat Easy 32 to 8. Searching wider, looking a turn further ahead, or nudging the weights one at a time all failed to beat Hard, so Hard is the strongest level for now. Adaptive plays at Hard strength until it gets well ahead, then eases off.

    Puzzles you can trust

    Each puzzle comes from a computer game. The best turn is found by trying every first edge and every second edge that could matter, then replaying the best candidates exactly until nothing left could beat them. A separate check then plays out every legal pair of edges on the engine alone and confirms the answer. Block puzzles are checked the same way: every edge you could place, against every enemy edge that could cut you after it.

    Plan-ahead puzzles are the exception. Four edges in a row have far too many combinations to try them all, so the target is the best plan a search found, and it's always more than two separate best turns would get. The puzzle asks you to reach it, not to prove nothing beats it.

    Online play

    Online games connect browsers directly with WebRTC. A public PeerJS server only introduces them. The host's browser keeps the official move list and passes moves on to the other players and anyone watching.

    This is an unofficial fan-made version of the game, built from the rules as shown in its reveal video. The code is on GitHub.

    New game

    How you're playing
    Players
    Length
    You play
    Computer level

    Name each seat, and pick who plays it. Computer seats play themselves.

    You get a link to send. Seats nobody takes can be filled with the computer before the game starts.

    Time per turn
    Clock
    House rules

    Play friends online

    Send this link to your friends. The game starts when every seat is filled.

    Anyone can watch with this link:

    Moves go straight between browsers. The link works while the host keeps the page open.

    Settings

    Look
    Online connection

    If online games won't connect on your network, you can add a relay (TURN) server you have access to. Leave this empty otherwise.

    Problems

    If something goes wrong, copy a report and paste it into a new issue on GitHub. It lists recent errors and your browser, nothing else.

    Game over

    New tournament

    One player per line. Add a computer player by writing computer easy, computer medium or computer hard.

    Games
    Clock