User:Ian07/Test/Template: Difference between revisions

From LifeWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
<includeonly>{{#switch: {{{position|right}}}
<includeonly><table class="infobox">
| right = <div class="thumb tnone" style="float: right; {{{style|margin-left: 1em; margin-bottom: 1em;}}}"><div class="thumbinner"><div class="image">{{LV:Viewer|{{{rle|{{RLE:{{{pname}}}}}}}}
<tr>
{{LifeViewer config/default}}
<td colspan="2" class="infobox_head"> {{#if:{{{name|}}} | {{{name|}}} | Rule {{{number|}}} }}</td>
{{{viewerconfig|}}}}}</div><div class="thumbcaption">{{{caption|}}} (click above to open [[LifeViewer]]){{#if: {{{pname|}}} | <br>'''[[RLE]]:''' [https://www.conwaylife.com/patterns/{{{pname}}}.rle here] '''[[Plaintext]]:''' [https://www.conwaylife.com/patterns/{{{pname}}}.cells here] | }}{{#if: {{{apgcode|}}} | <br>{{LinkCatagolue|{{#explode:{{{apgcode}}}|/|0}}|rule={{#if: {{#explode:{{{apgcode}}}|/|1}} | {{#explode:{{{apgcode}}}|/|1}} | b3s23}}|style=brief}} | }}</div></div></div>
</tr>
| left = <div class="thumb tnone" style="float: left; {{{style|margin-right: 1em; margin-bottom: 1em;}}}"><div class="thumbinner"><div class="image">{{LV:Viewer|{{{rle|{{RLE:{{{pname}}}}}}}}
<tr><td colspan="2" class="infobox_img">{{EmbedViewerRule1D|w={{{number|}}}}}</td></tr>
{{LifeViewer config/default}}
{{#if: {{{imgname|}}} | <tr>
{{{viewerconfig|}}}}}</div><div class="thumbcaption">{{{caption|}}} (click above to open [[LifeViewer]]){{#if: {{{pname|}}} | <br>'''[[RLE]]:''' [https://www.conwaylife.com/patterns/{{{pname}}}.rle here] '''[[Plaintext]]:''' [https://www.conwaylife.com/patterns/{{{pname}}}.cells here] | }}{{#if: {{{apgcode|}}} | <br>{{LinkCatagolue|{{#explode:{{{apgcode}}}|/|0}}|rule={{#if: {{#explode:{{{apgcode}}}|/|1}} | {{#explode:{{{apgcode}}}|/|1}} | b3s23}}|style=brief}} | }}</div></div></div>
<td colspan="2" class="infobox_animlink">[[Media:{{{imgname|}}}.png|View static image]]</td>
| center = <table class="toccolours" style="margin-left: auto; margin-right: auto; width: fit-content; {{{style|}}}"><tr><td align="center">{{LV:Viewer|{{{rle|{{RLE:{{{pname}}}}}}}}
</tr>
{{LifeViewer config/default}}
}}
{{{viewerconfig|}}}}}</td></tr><tr><td align="center">{{{caption|}}} (click above to open [[LifeViewer]]){{#if: {{{pname|}}} | <br>'''[[RLE]]:''' [https://www.conwaylife.com/patterns/{{{pname}}}.rle here] '''[[Plaintext]]:''' [https://www.conwaylife.com/patterns/{{{pname}}}.cells here] | }}{{#if: {{{apgcode|}}} | <br>{{LinkCatagolue|{{#explode:{{{apgcode}}}|/|0}}|rule={{#if: {{#explode:{{{apgcode}}}|/|1}} | {{#explode:{{{apgcode}}}|/|1}} | b3s23}}|style=brief}} | }}</td></tr></table>
{{#if: {{{animated|}}} | <tr>
}}{{#if: {{{pname|}}} | | {{#if:{{NAMESPACE}} | {{#ifeq:{{NAMESPACE}} | OCA | [[Category:Articles using EmbedViewer with no pname]] }} | [[Category:Articles using EmbedViewer with no pname]] }} }}</includeonly><noinclude>
<td colspan="2" class="infobox_animlink">[[Media:{{{imgname|}}}.gif|View animated image]]</td>
</tr>
}}
<tr>
<th>Number</th>
<td>{{{number|}}}</td>
</tr>
<tr>
<th> Character </th>
<td> {{#if: {{{char|}}} | {{{char|}}} | Miscellaneous }} </td>
</tr>
</table></includeonly><noinclude>
{{Rule1D
|name        = Apples
|imgname    = apples
|number      = &omega; - 1
|char        = Tasty
|animated    = true
}}
The rule template is an infobox template for rules for [[one-dimensional cellular automata]]. It takes the following parameters:


</noinclude>
* <tt>name</tt>: the name of the rule.
* <tt>imgname</tt>: the name of the image (of a typical pattern) to display in the infobox; <tt>.png</tt> and <tt>.gif</tt> are appended automatically for the still and animated versions. The <tt>File:</tt> prefix should not be specified.
* <tt>animated</tt>: should be set to <tt>true</tt> if an animated image for this rule has been uploaded.
* <tt>number</tt>: the rule's number.
* <tt>char</tt>: the rule's character. Should be one of:
** <tt>Stable</tt>: rules in which patterns tend to stabilize quickly and show little activity.
** <tt>Chaotic</tt>: rules in which patterns tend to show complex behavior, but do not generally explode.
** <tt>Explosive</tt>: rules in which patterns tend to grow without bound.
 
==Example==
An example can been seen to the right; it was generated with the following invocation:
 
<nowiki>{{Rule1D
|name        = Apples
|imgname    = apples
|number      = &omega; - 1
|char        = Tasty
|animated    = true
}}
</nowiki>
 
[[Category:Infobox templates]]
</noinclude><includeonly>
[[Category:Everything else]][[Category:Cellular automata]][[Category:One-dimensional cellular automata]]
</includeonly>

Revision as of 23:09, 4 January 2022

Apples
x=0, y = 0, rule = Wω - 1 ! #C [[ THEME Inverse ]] #C [[ RANDOMIZE2 THUMBLAUNCH THUMBNAIL THUMBSIZE 2 GRID ZOOM 6 WIDTH 600 HEIGHT 600 LABEL 90 -20 2 "#G" AUTOSTART PAUSE 2 GPS 8 LOOP 256 ]]
LifeViewer-generated pseudorandom soup
Number ω - 1
Computation
Character Tasty

The rule template is an infobox template for rules for one-dimensional cellular automata. It takes the following parameters:

  • name: the name of the rule.
  • imgname: the name of the image (of a typical pattern) to display in the infobox; .png and .gif are appended automatically for the still and animated versions. The File: prefix should not be specified.
  • animated: should be set to true if an animated image for this rule has been uploaded.
  • number: the rule's number.
  • char: the rule's character. Should be one of:
    • Stable: rules in which patterns tend to stabilize quickly and show little activity.
    • Chaotic: rules in which patterns tend to show complex behavior, but do not generally explode.
    • Explosive: rules in which patterns tend to grow without bound.

Example

An example can been seen to the right; it was generated with the following invocation:

{{Rule1D
 |name        = Apples
 |imgname     = apples
 |number      = ω - 1
 |char        = Tasty
 |animated    = true
}}