Template:Rectangle 8x8/doc
From The Scuba Wiki
This template produces a rectangle consisting of 8 by 8 small rectangles, where the kth cell is produced by the template with name {{{t}}} as follows:
- {{{{{t}}}|{{{k }}}|w={{{w}}}|h={{{h}}}}}.
Example
In this example the 64 cell parameters are color codes, while w is the width and h the height. For each color code used there has to be template like Template:color r containing "red
".
{{rectangle 8x8|t=box|w=40|h=40|= |r|g|g|g|b|r|r|g|= |r|r|g|b|b|b|r|g|= |r|r|g| |b|r|r|g|= |g|l|l|l|f| |b|g|= |g|l| |f|f|b|b|g|= |g|l|f|f| |r|b|b|= |g|g|b|b|g|r|r|r|= |b|b|b|g|g|g|g|r|= }}
gives:
Checkerboard pentomino, solution from [1].
Empty parameters are allowed, they become white cells.
For various image sizes, see Template talk:Square 8x8 pentomino example.
Rectangle of another size than 8x8
For producing the wikitext for a similar template producing a rectangle of another size than 8x8:
- if the number of squares is the same or less: delete unneeded lines and move the codes "|-" for "new row"
- to use more similar lines of wikitext, see below, use lines of wikitext from below, or produce them with template:Numbered repetition/100 ( talk edit history links ) and template:Numbered repetition nl0/100 ( talk edit history links ) (nl0 = no leading zeros, parameter 02 is distinguished from parameter 2). The codes "|-" for "new row" still have to be inserted.
{{Numbered repetition nl0/100|<br>|{{{{{t}}}|{{{|}}}|w={{{w}}}|h={{{h}}}}}}} {{Numbered repetition/100|<br>|{{{{{t}}}|{{{1|}}}|w={{{w}}}|h={{{h}}}}}}}
gives
|{{{{{t}}}|{{{0}}}|w={{{w}}}|h={{{h}}}}}
|{{{{{t}}}|{{{1}}}|w={{{w}}}|h={{{h}}}}}
|{{{{{t}}}|{{{2}}}|w={{{w}}}|h={{{h}}}}}
|{{{{{t}}}|{{{3}}}|w={{{w}}}|h={{{h}}}}}
|{{{{{t}}}|{{{4}}}|w={{{w}}}|h={{{h}}}}}
|{{{{{t}}}|{{{5}}}|w={{{w}}}|h={{{h}}}}}
|{{{{{t}}}|{{{6}}}|w={{{w}}}|h={{{h}}}}}
|{{{{{t}}}|{{{7}}}|w={{{w}}}|h={{{h}}}}}
|{{{{{t}}}|{{{8}}}|w={{{w}}}|h={{{h}}}}}
|{{{{{t}}}|{{{9}}}|w={{{w}}}|h={{{h}}}}}Template loop detected: Template:List of template calls 1
|{{{{{t}}}|{{{100}}}|w={{{w}}}|h={{{h}}}}}
|{{{{{t}}}|{{{101}}}|w={{{w}}}|h={{{h}}}}}
|{{{{{t}}}|{{{102}}}|w={{{w}}}|h={{{h}}}}}
|{{{{{t}}}|{{{103}}}|w={{{w}}}|h={{{h}}}}}
|{{{{{t}}}|{{{104}}}|w={{{w}}}|h={{{h}}}}}
|{{{{{t}}}|{{{105}}}|w={{{w}}}|h={{{h}}}}}
|{{{{{t}}}|{{{106}}}|w={{{w}}}|h={{{h}}}}}
|{{{{{t}}}|{{{107}}}|w={{{w}}}|h={{{h}}}}}
|{{{{{t}}}|{{{108}}}|w={{{w}}}|h={{{h}}}}}
|{{{{{t}}}|{{{109}}}|w={{{w}}}|h={{{h}}}}}Template loop detected: Template:List of template calls 1
Frieze groups example
While the image on the right is fine too, the image on the left has the advantage that it is much easier to edit, just by editing the wikitext, without a graphics program and without a file upload procedure. Also, when changing the image diff works.
Note: the image on the left should not be seen as a crude approximation of the image on the right, but as a set of examples in its own right, with the elegance of simplicity in terms of the number of pixels needed.