Difference between revisions of "Template"

From HexWiki
Jump to: navigation, search
m (category -> templates)
(Added two other template types)
 
(13 intermediate revisions by 5 users not shown)
Line 1: Line 1:
A '''template''' is a [[pattern]] which guarantees some kind of [[connection]]. There are several different (and sometimes overlapping) types:
+
A '''template''' is a minimal [[pattern]] that guarantees some kind of [[connection]]. There are several different (and sometimes overlapping) types:
  
 
* [[:Category:Edge templates |Edge templates]]
 
* [[:Category:Edge templates |Edge templates]]
* [[Ladder template]]s
 
 
* [[Interior template]]s
 
* [[Interior template]]s
 +
* [[Ladder escape template]]s
 +
* [[Ladder creation template]]s
 +
* [[Pivoting template]]s
 +
* [[Second order template]]s
 +
 +
 +
== Carrier ==
 +
 +
The '''carrier''' of a template consists of all of those cells (occupied or empty) that are part of the template. Empty cells in a template's carrier are an important part of the template and must not be ignored. If any of these cells are occupied by the opponent, the template is no longer valid.
 +
 +
== Validity ==
 +
 +
We say that a proposed template is '''valid''' if it actually guarantees the kind of connection that it is claimed to guarantee, and '''invalid''' otherwise.
 +
 +
A pattern that is suspected of being a template, but has not yet been proven to be valid, can be called a '''template candidate'''.
 +
 +
== Minimality ==
 +
 +
Templates are, by definition, minimal. This means that removing any of the stones or empty hexes from the template would invalidate the template. For example, the following pattern guarantees a virtual connection of the red stones to the edge. However, it is not a template, because it is not minimal.
 +
<hexboard size="4x5"
 +
  coords="hide"
 +
  edges="bottom"
 +
  visible="area(d1,a4,e4,e1)"
 +
  contents="R d1 e1"
 +
  />
 +
The following pattern has a smaller carrier and guarantees the same connection. It is minimal, i.e., removing any more empty hexes or any red stone makes the pattern invalid. Since the pattern is both valid and minimal, it is a template. It is known as [[Edge_template_IV2a|edge template IV-2-a]].
 +
<hexboard size="4x4"
 +
  coords="hide"
 +
  edges="bottom"
 +
  visible="area(c1,b2,a4,d4,d1)"
 +
  contents="R c1 d1"
 +
  />
 +
Sometimes it is convenient to talk about a pattern that is connected but perhaps not minimal. Such a pattern can be called a '''pre-template'''. Every pre-template contains a template, obtained by removing unnecessary cells until it is minimal. When new large templates are discovered, they often start their life as pre-templates, until someone finishes the time-consuming task of checking minimality.
 +
 +
== Overlapping templates ==
 +
 +
Two templates '''overlap''' if some empty cell belongs to both of their carriers. Care must be taken with overlapping templates: although each template may be valid individually, the overlapping templates may not form a valid connection as a whole. The simplest example is the following situation, called a ''U-turn'':
 +
<hexboard size="5x5"
 +
  coords="none"
 +
  edges="none"
 +
  visible="area(b3,b4,c4,d3,d2,c2)"
 +
  contents="B b3 R 3:b4 R 1:c2 R 2:d3 E *:c3"
 +
  />
 +
Although 1 is connected to 2 via a valid [[bridge]] template, and 2 is connected to 3 via a valid bridge template, 1 is not connected to 3, because the bridges overlap at *. In fact, if Blue plays at *, Red cannot defend both bridges in a single move.
  
 
== See also ==
 
== See also ==
Line 11: Line 54:
 
== Reference ==
 
== Reference ==
  
* [http://www.drking.plus.com/hexagons/hex/templates.html David King's Hex template page]
+
* [https://www.drking.org.uk/hexagons/hex/templates.html David King's Hex template page]
* [http://www.f.kth.se/~rydh/Hex/templates.html Jonatan Rydh's Hex edge templates page]
+
  
[[category:templates]]
+
[[category: Templates]]
 +
[[category: Connection types]]
 +
[[category: Definition]]

Latest revision as of 20:01, 19 February 2024

A template is a minimal pattern that guarantees some kind of connection. There are several different (and sometimes overlapping) types:


Carrier

The carrier of a template consists of all of those cells (occupied or empty) that are part of the template. Empty cells in a template's carrier are an important part of the template and must not be ignored. If any of these cells are occupied by the opponent, the template is no longer valid.

Validity

We say that a proposed template is valid if it actually guarantees the kind of connection that it is claimed to guarantee, and invalid otherwise.

A pattern that is suspected of being a template, but has not yet been proven to be valid, can be called a template candidate.

Minimality

Templates are, by definition, minimal. This means that removing any of the stones or empty hexes from the template would invalidate the template. For example, the following pattern guarantees a virtual connection of the red stones to the edge. However, it is not a template, because it is not minimal.

The following pattern has a smaller carrier and guarantees the same connection. It is minimal, i.e., removing any more empty hexes or any red stone makes the pattern invalid. Since the pattern is both valid and minimal, it is a template. It is known as edge template IV-2-a.

Sometimes it is convenient to talk about a pattern that is connected but perhaps not minimal. Such a pattern can be called a pre-template. Every pre-template contains a template, obtained by removing unnecessary cells until it is minimal. When new large templates are discovered, they often start their life as pre-templates, until someone finishes the time-consuming task of checking minimality.

Overlapping templates

Two templates overlap if some empty cell belongs to both of their carriers. Care must be taken with overlapping templates: although each template may be valid individually, the overlapping templates may not form a valid connection as a whole. The simplest example is the following situation, called a U-turn:

123

Although 1 is connected to 2 via a valid bridge template, and 2 is connected to 3 via a valid bridge template, 1 is not connected to 3, because the bridges overlap at *. In fact, if Blue plays at *, Red cannot defend both bridges in a single move.

See also

Reference