Template:PatternDownload: Difference between revisions

From LifeWiki
Jump to navigation Jump to search
m Changed protection level for "Template:PatternDownload" ([Edit=<protect-level-trusted>] (indefinite) [Move=<protect-level-trusted>] (indefinite))
1) Display "rules" section if rulemin is specified but not rulemax. 2) Display "unknown" for rulemin/max if not specified. 3) Don't compute number of rules rulemin or rulemax is not specified.
Line 1: Line 1:
<includeonly>{{#if: {{{rulemax|}}}{{{rulespecial|}}} | <tr>
<includeonly>{{#if: {{{rulemin|}}}{{{rulemax|}}}{{{rulespecial|}}} | <tr>
<td colspan="2" style="height:3px;"></td></tr>
<td colspan="2" style="height:3px;"></td></tr>
<tr>
<tr>
Line 10: Line 10:
{{!}}-
{{!}}-
! All&nbsp;rules
! All&nbsp;rules
{{!}} style="text-align:right;" {{!}} {{#ifeq: {{{rulemin|}}} | {{{rulemax|}}} | {{{rulemax|}}} only | {{{rulemin|}}}&nbsp;–&nbsp;{{{rulemax|}}}}}
{{!}} style="text-align:right;" {{!}} {{#ifeq: {{{rulemin|}}} | {{{rulemax|}}} | {{{rulemax|}}} only | {{{rulemin|unknown}}}&nbsp;–&nbsp;{{{rulemax|unknown}}}}}
{{#if: {{{rulespecial|}}} | {{!}}-
{{#if: {{{rulespecial|}}} | {{!}}-
! Important&nbsp;rules
! Important&nbsp;rules
Line 16: Line 16:
{{!}}- | {{!}}- }}
{{!}}- | {{!}}- }}
! #&nbsp;of&nbsp;rules
! #&nbsp;of&nbsp;rules
{{!}} style="text-align:right;" {{!}} 2<sup>{{#expr:{{#len:{{{rulemax|}}}}}-{{#len:{{{rulemin|}}}}}}}</sup> = {{#expr: 2^({{#len:{{{rulemax|}}}}}-{{#len:{{{rulemin|}}}}})}}
{{!}} style="text-align:right;" {{!}} {{#if: {{{rulemin|}}}{{{rulemax|}}} | 2<sup>{{#expr:{{#len:{{{rulemax|}}}}}-{{#len:{{{rulemin|}}}}}}}</sup> = {{#expr: 2^({{#len:{{{rulemax|}}}}}-{{#len:{{{rulemin|}}}}})}} }}
{{!}}}
{{!}}}
</td></tr>
</td></tr>

Revision as of 00:04, 24 July 2016

This template displays the "Rules", "Glider synthesis" and "Pattern files" boxes that appear on the right hand side of pattern pages. It should not be used on its own, but only within other pattern infobox template such as Template:Pattern and Template:Oscillator. All of its parameters are passed in from the corresponding parameters of the template that calls it.