Difference between revisions of "Template:PatternDownload"

From LifeWiki
Jump to navigation Jump to search
(Let's try to be sneaky and actually test for an empty string here, rather than an unpassed parameter. Hope this'll work -- hooves crossed.)
(moved to hatsya.com per https://gitlab.com/apgoucher/catagolue/-/commit/af43ef6ebec27a311e3389c962c46089a0c84c96)
(20 intermediate revisions by 3 users not shown)
Line 9: Line 9:
<th colspan="2" class="infobox_subhead">[[Life-like cellular automaton|Rules]]</th></tr>
<th colspan="2" class="infobox_subhead">[[Life-like cellular automaton|Rules]]</th></tr>
<tr>
<tr>
<td> Outer-totalistic&nbsp;rules </td>
<th> [[Outer-totalistic]]&nbsp;rules </th>
<td style="text-align:right;"> {{#ifeq: {{{rulemin|}}} | {{{rulemax|}}} | {{{rulemax|}}} only | {{#if:{{{rulemin|}}}|{{{rulemin}}}|unknown}}&nbsp;–&nbsp;{{#if:{{{rulemax|}}}|{{{rulemax}}}|unknown}}}}</td><tr />
<td style="text-align:right;"> {{#ifeq: {{{rulemin|}}} | {{{rulemax|}}} | {{{rulemax|}}} only | {{#if:{{{rulemin|}}}|{{{rulemin}}}|unknown}}&nbsp;–&nbsp;{{#if:{{{rulemax|}}}|{{{rulemax}}}|unknown}}}}</td><tr />
{{#if: {{{rulespecial|}}} | <tr>
{{#if: {{{rulespecial|}}} | <tr>
<td> Important&nbsp;rules </td>
<th> Important&nbsp;rules </th>
<td style="text-align:right;" valign="top"> {{{rulespecial|}}} </td></tr>
<td style="text-align:right;" valign="top"> {{{rulespecial|}}} </td></tr>
}}<tr>
}}<tr>
<td> #&nbsp;of&nbsp;rules </td>
<th> #&nbsp;of&nbsp;rules </th>
<td style="text-align:right;"> {{#if: {{{rulemin|}}} | {{#if: {{{rulemax|}}} | 2<sup>{{#expr:{{#len:{{{rulemax|}}}}}-{{#len:{{{rulemin|}}}}}}}</sup> = {{#expr: 2^({{#len:{{{rulemax|}}}}}-{{#len:{{{rulemin|}}}}})}} | Unknown }} | Unknown }} </td></tr>
<td style="text-align:right;"> {{#if: {{{rulemin|}}} | {{#if: {{{rulemax|}}} | 2<sup>{{#expr:{{#len:{{{rulemax|}}}}}-{{#len:{{{rulemin|}}}}}}}</sup> = {{#expr: 2^({{#len:{{{rulemax|}}}}}-{{#len:{{{rulemin|}}}}})}} | Unknown }} | Unknown }} </td></tr>
{{#if: {{{isorulemin|}}}{{{isorulemax|}}} | <tr>
{{#if: {{{isorulemin|}}}{{{isorulemax|}}} | <tr>
<td> Isotropic&nbsp;rules </td>
<th> [[Isotropic non-totalistic|Isotropic]]&nbsp;rules </th>
<td style="text-align:right;"> {{#ifeq: {{{isorulemin|}}} | {{{isorulemax|}}} | {{{isorulemax|}}} only | {{#if:{{{isorulemin|}}}|{{{isorulemin}}}|unknown}}&nbsp;–&nbsp;{{#if:{{{isorulemax|}}}|{{{isorulemax}}}|unknown}}}}</td></tr>
<td style="text-align:right;"> {{#ifeq: {{{isorulemin|}}} | {{{isorulemax|}}} | {{{isorulemax|}}} only | {{#if:{{{isorulemin|}}}|{{{isorulemin}}}|unknown}}&nbsp;–&nbsp;{{#if:{{{isorulemax|}}}|{{{isorulemax}}}|unknown}}}}</td></tr>
}}</table>
}}</table>
Line 30: Line 30:
{{#ifeq: {{{synthesis|}}} | 0 | <tr>
{{#ifeq: {{{synthesis|}}} | 0 | <tr>
<td colspan="2" style="text-align:center;"> Synthesis is [[:Category:Patterns that can not be constructed with gliders|not possible]].</td></tr> |  
<td colspan="2" style="text-align:center;"> Synthesis is [[:Category:Patterns that can not be constructed with gliders|not possible]].</td></tr> |  
{{#ifeq: x{{{synthesis|}}} | x | | <tr>
{{#if: {{{synthesis|}}} | <tr>
<th> Fewest&nbsp;[[glider]]s </th>
<th> Fewest&nbsp;[[glider]]s </th>
<td style="text-align:right;"> {{#ifexpr: {{{synthesis|0}}} >= 1000 | [[:Category:Patterns that can be constructed with 1000 or more gliders|{{{synthesis|}}}]] | [[:Category:Patterns that can be constructed with {{{synthesis|}}} gliders|{{{synthesis|}}}]] }}{{#ifexpr: {{{synthesis|0}}} > {{Reverse caber tosser/Lower bound}} | &nbsp;({{Reverse caber tosser/Lower bound}}<sup>&dagger;</sup>) | }} </td></tr>
<td style="text-align:right;"> {{#ifexpr: {{{synthesis|0}}} >= 101 | [[:Category:Patterns that can be constructed with 101 or more gliders|{{{synthesis|}}}]] | [[:Category:Patterns that can be constructed with {{{synthesis|}}} gliders|{{{synthesis|}}}]] }}{{#ifexpr: 0{{{synthesis|0}}} > {{Reverse caber tosser/Lower bound}} | &nbsp;({{Reverse caber tosser/Lower bound}}<sup>&dagger;</sup>) | }} </td></tr>
}}{{#if: {{{synthesisRLE|}}} | <tr>
}}
<th> [[RLE]] </th>
{{#if: {{{apgcode|}}} | <tr>
<td style="text-align:right;"> [http://www.conwaylife.com/patterns/{{{pname|name}}}_synth.rle {{{pname|name}}}_synth.rle] </td></tr>
<th> [[Catagolue]]-generated [[RLE]] </th>
<td style="text-align:right;"> [https://catagolue.hatsya.com/textsamples/{{{apgcode|apgcodenotfound}}}/b3s23/synthesis {{{pname|namenotfound}}}_synth.rle] </td></tr>
}}
{{#if: {{{synthesisRLE|}}} | <tr>
<th> Uploaded synthesis [[RLE]] </th>
<td style="text-align:right;"> [https://www.conwaylife.com/patterns/{{{pname|namenotfound}}}_synth.rle {{{pname|namenotfound}}}_synth.rle] </td></tr>
| {{#ifexist:RLE:{{{pname}}}_synth|<tr>
| {{#ifexist:RLE:{{{pname}}}_synth|<tr>
<th>[[RLE]]</th>
<th>[[RLE]]</th>
<td style="text-align:right;"> [[RLE:{{{pname}}}_synth|raw RLE code]] [[Category:Pages with raw synthesis RLE code but no uploaded synthesis files]] </td></tr> }} }} }}
<td style="text-align:right;"> [[RLE:{{{pname}}}_synth|raw RLE code]] [[Category:Pages with raw synthesis RLE code but no uploaded synthesis files]] </td></tr> }} }} }}
{{#if: {{{apgcode|}}} | <tr>
<!--{{#if: {{{apgcode|}}} | <tr>
<th> Auto-generated synthesis </th>
<th> Auto-generated synthesis </th>
<td style="text-align:right; word-break: break-all"> [https://glidersynth.neocities.org/?{{{apgcode|}}} {{{apgcode|}}}]<br />[https://catagolue.appspot.com/js/glidersynth.html?{{{apgcode|}}} {{{apgcode|}}}] (alt.)</td></tr>
<td style="text-align:right; word-break: break-all"> [https://glidersynth.neocities.org/?{{{apgcode|}}} {{{apgcode|}}}]<br />[https://catagolue.hatsya.com/js/glidersynth.html?{{{apgcode|}}} {{{apgcode|}}}] (alt.)</td></tr>
}}
}}-->
{{#if: {{{pentadecathlonid|}}} |  
{{#if: {{{pentadecathlonid|}}} |  
<tr>
<tr>
Line 50: Line 55:
<th> As result </th>
<th> As result </th>
<td style="text-align:right;"> [http://pentadecathlon.com/objects/object-info.php?objid={{{pentadecathlonid|}}}&content=constructions {{{pentadecathlonid|}}}] </td></tr>
<td style="text-align:right;"> [http://pentadecathlon.com/objects/object-info.php?objid={{{pentadecathlonid|}}}&content=constructions {{{pentadecathlonid|}}}] </td></tr>
}}{{#ifexpr: {{{synthesis|0}}} > {{Reverse caber tosser/Lower bound}} | <tr>
}}{{#ifexpr: 0{{{synthesis|0}}} > {{Reverse caber tosser/Lower bound}} | <tr>
<td colspan="2"><sup>&dagger;</sup>Can be constructed with {{Reverse caber tosser/Lower bound}} gliders using the [[reverse caber tosser]] [[universal constructor]].</td></tr>
<td colspan="2"><sup>&dagger;</sup>Can be constructed with {{Reverse caber tosser/Lower bound}} gliders using the [[reverse caber tosser]] [[universal constructor]].</td></tr>
}}</table></td></tr> }} {{#if: {{{zip|}}}{{{mc|}}}{{{life105|}}}{{{life106|}}}{{{plaintext|}}}{{{rle|}}}{{#ifexist:RLE:{{{pname}}}|true|}} |
}}</table></td></tr> }} {{#if: {{{zip|}}}{{{mc|}}}{{{plaintext|}}}{{{rle|}}}{{#ifexist:RLE:{{{pname}}}|true|}} |
<tr>
<tr>
<td colspan="2" style="height:3px;"></td></tr>
<td colspan="2" style="height:3px;"></td></tr>
Line 62: Line 67:
<tr>
<tr>
<th colspan="2" class="infobox_subhead"> Pattern files </th></tr>
<th colspan="2" class="infobox_subhead"> Pattern files </th></tr>
{{#if: {{{life105|}}} | <tr>
{{#if: {{{mc|}}} | <tr>
<th>[[Life 1.05]]</th>
<td style="text-align:right;"> [http://www.conwaylife.com/patterns/{{{pname|name}}}_105.lif {{{pname|name}}}_105.lif]</td></tr>
}} {{#if: {{{life106|}}} | <tr>
<th>[[Life 1.06]]</th>
<td style="text-align:right;"> [http://www.conwaylife.com/patterns/{{{pname|name}}}_106.lif {{{pname|name}}}_106.lif]</td></tr>
}} {{#if: {{{mc|}}} | <tr>
<th>[[Macrocell]]</th>
<th>[[Macrocell]]</th>
<td style="text-align:right;"> [http://www.conwaylife.com/patterns/{{{pname|name}}}.mc {{{pname|name}}}.mc]</td></tr>
<td style="text-align:right;"> [https://www.conwaylife.com/patterns/{{{pname|name}}}.mc {{{pname|name}}}.mc]</td></tr>
}} {{#if: {{{plaintext|}}} | <tr>
}} {{#if: {{{plaintext|}}} | <tr>
<th>[[Plaintext]]</th>
<th>[[Plaintext]]</th>
<td style="text-align:right;"> [http://www.conwaylife.com/patterns/{{{pname|name}}}.cells {{{pname|name}}}.cells]</td></tr>
<td style="text-align:right;"> [https://www.conwaylife.com/patterns/{{{pname|name}}}.cells {{{pname|name}}}.cells]</td></tr>
}} {{#if: {{{rle|}}} | <tr>
}} {{#if: {{{rle|}}} | <tr>
<th>[[RLE]]</th>
<th>[[RLE]]</th>
<td style="text-align:right;"> [http://www.conwaylife.com/patterns/{{{pname|name}}}.rle {{{pname|name}}}.rle]</td></tr>
<td style="text-align:right;"> [https://www.conwaylife.com/patterns/{{{pname|name}}}.rle {{{pname|name}}}.rle]</td></tr>
| {{#ifexist:RLE:{{{pname}}}|<tr>
| {{#ifexist:RLE:{{{pname}}}|<tr>
<th>[[RLE]]</th>
<th>[[RLE]]</th>
Line 83: Line 82:
}} {{#if: {{{zip|}}} | <tr>
}} {{#if: {{{zip|}}} | <tr>
<th>Zip archive</th>
<th>Zip archive</th>
<td style="text-align:right;"> [http://www.conwaylife.com/patterns/{{{pname|name}}}.zip {{{pname|name}}}.zip]</td></tr>
<td style="text-align:right;"> [https://www.conwaylife.com/patterns/{{{pname|name}}}.zip {{{pname|name}}}.zip]</td></tr>
}}</table>
}}</table>
}}{{#if: {{{synthesis|}}} | {{#ifeq: {{{synthesis|}}} | 0 | [[Category:Patterns that can not be constructed with gliders]] | {{#ifexpr: {{{synthesis|0}}} >= 1000 | [[Category:Patterns that can be constructed with 1000 or more gliders]] | [[Category:Patterns that can be constructed with {{{synthesis|}}} gliders]] }} }} }}
}}
</includeonly>
{{#ifeq:{{NAMESPACE}}|User||
{{#if: {{{synthesis|}}} | {{#ifeq: {{{synthesis|}}} | 0 | [[Category:Patterns that can not be constructed with gliders]] | {{#ifexpr: {{{synthesis|0}}} >= 101 | [[Category:Patterns that can be constructed with 101 or more gliders]] | [[Category:Patterns that can be constructed with {{{synthesis|}}} gliders]] }} }} }}{{#if: {{{rulemin|}}} | {{#if: {{{rulemax|}}} | {{#ifeq: {{{rulemin}}} | {{{rulemax}}} | [[Category:Outer-totalistically endemic patterns]] }}}}}}{{#if: {{{isorulemin|}}} | {{#if: {{{isorulemax|}}} | {{#ifeq: {{{isorulemin}}} | {{{isorulemax}}} | [[Category:Isotropically endemic patterns]] }}}}}}
}}</includeonly>
<noinclude>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 templates such as [[Template:Pattern]] and [[Template:Oscillator]]. All of its parameters are passed in from the corresponding parameters of the template that calls it.
<noinclude>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 templates such as [[Template:Pattern]] and [[Template:Oscillator]]. All of its parameters are passed in from the corresponding parameters of the template that calls it.
[[Category:Infobox templates]]</noinclude>
[[Category:Infobox templates]]</noinclude>

Revision as of 21:45, 28 September 2020

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 templates such as Template:Pattern and Template:Oscillator. All of its parameters are passed in from the corresponding parameters of the template that calls it.