Difference between revisions of "Template:Reflector"

From LifeWiki
Jump to navigation Jump to search
(MC support)
(pass apgcode to PatternDownload (mainly for Snark))
 
(22 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<includeonly>{{#if: {{{mc|}}}{{{life105|}}}{{{life106|}}}{{{plaintext|}}}{{{rle|}}}{{{nofile|}}} | | {{requestpatternfile}} }}</includeonly>
+
<!--
<table class="infobox">
+
 
<tr><td colspan="2" class="infobox_head"> {{{name|Reflector Name}}} </td></tr>
+
Begin infobox
<tr>
+
 
<td colspan="2" class="infobox_img"><table class="img_border" cellpadding="0"><tr><td>{{#if: {{{mc|}}}{{{life105|}}}{{{life106|}}}{{{plaintext|}}}{{{rle|}}}{{{nofile|}}} | [[Image:{{{pname|}}}.png|{{{name}}} image]]|[[Image:UnknownPattern.png|{{{name}}} image]]}}</td></tr></table></td></tr>{{#if: {{{animated|}}} | <tr><td colspan="2" class="infobox_animlink"> [[Media:{{{pname|name}}}.gif|View animated image]] </td></tr> }}
+
-->{{InfoboxStart
<!-- {{#if: {{{rle|}}} | <tr><td colspan="2" class="infobox_link"> [http://www.conwaylife.com?p={{{pname|name}}} Manipulate via Java] </td></tr> }} -->
+
|typename      = Reflector
<tr>
+
|defaultconfig = reflector
<th> Pattern type </th>
+
|viewerconfig  = {{{viewerconfig|}}}
<td> {{#ifeq:{{lc:{{{type}}}}}|stable|[[Stable reflector]]|[[Reflector]]{{#ifeq:{{lc:{{{isosc|}}}}}|false||<br />[[Oscillator]]}}}} </td></tr>
+
|name          = {{{name|}}}
<tr>
+
|zip          = {{{zip|}}}
<th> Number of [[cell]]s </th>
+
|mc            = {{{mc|}}}
<td> {{#if: {{{c|}}} | {{#ifexpr: {{{c|}}} >= 1000 | [[:Category:Patterns with 1000 or more cells|{{{c}}}]] | [[:Category:Patterns with {{{c}}} cells|{{{c}}}]] }} | Unknown }} </td></tr>
+
|life105      = {{{life105|}}}
<tr>
+
|life106      = {{{life106|}}}
<th> [[Bounding box]] </th>
+
|plaintext    = {{{plaintext|}}}
<td> {{#if: {{{bx|}}} | {{{bx}}}&times;{{{by}}} | Unknown }} </td></tr>
+
|rle          = {{{rle|}}}
 +
|nofile        = {{{nofile|}}}
 +
|pname        = {{{pname|}}}
 +
|animated     = {{{animated|}}}
 +
}}<!--
 +
 
 +
Display pattern type
 +
 
 +
--><tr>
 +
<th valign="top"> Pattern type </th>
 +
<td> {{#ifeq: {{lc:{{{type}}}}} | stable | [[Stable reflector]] | [[Reflector]] {{#ifeq: {{lc:{{{isosc|}}}}} | false | | <br />[[Oscillator]] }} }} </td></tr><!--
 +
 
 +
Display population and bounding box
 +
 
 +
-->{{PatternPopulationAndBoundingBox
 +
|c        = {{{c|}}}
 +
|bx      = {{{bx|}}}
 +
|by      = {{{by|}}}
 +
|fc      = {{{fc|}}}
 +
}}<!--
 +
 
 +
Display an infobox divider
 +
 
 +
-->{{InfoboxDivider}}
 
<tr>
 
<tr>
 
<th> Angle </th>
 
<th> Angle </th>
<td> {{#if: {{{a|}}} | [[:Category:{{{a}}}_degree_reflectors|{{{a}}}°]] | Unknown}} </td></tr>
+
<td> {{#if: {{{a|}}} | [[:Category:{{{a}}} degree reflectors|{{{a}}}°]] | Unknown}} </td></tr>
 
<tr>
 
<tr>
<th> {{#ifeq:{{lc:{{{type|}}}}}|stable|[[Stable_reflector#Repeat_time|Repeat time]]|[[Period]]}} </th>
+
<th> {{#ifeq:{{lc:{{{type|}}}}}|stable|[[Stable reflector#Repeat time|Repeat time]]|[[Period]]}} </th>
<td> {{#if:{{{p|}}}|{{#ifeq:{{lc:{{{type|}}}}}|stable|{{{p}}}|{{#ifeq:{{lc:{{{isosc|}}}}}|false|{{{p}}}|[[:Category:Oscillators_with_period_{{{p}}}|{{{p}}}]]}}}}|Unknown}} </td></tr>
+
<td> {{#if:{{{p|}}}|{{#ifeq:{{lc:{{{type|}}}}}|stable|{{{p}}}|{{#ifeq:{{lc:{{{isosc|}}}}}|false|{{{p}}}|[[:Category:Oscillators with period {{{p}}}|{{{p}}}]]}}}}|Unknown}} </td></tr>
{{#ifeq:{{lc:{{{type|}}}}}|stable||<tr>
+
{{#ifeq: {{lc:{{{type|}}}}} | stable | | <tr>
 
<th> [[Heat]] </th>
 
<th> [[Heat]] </th>
<td> {{#if: {{{h|}}} | {{#iferror: {{#expr: floor({{{h}}})}} | {{{h}}} | [[:Category:Oscillators_with_heat_{{#expr: floor({{{h}}})}}|{{{h}}}]] }} | Unknown }} </td></tr> }}
+
<td> {{#if: {{{h|}}} | {{#iferror: {{#expr: floor({{{h}}})}} | {{{h}}} | [[:Category:Oscillators with heat {{#expr: floor({{{h}}})}}|{{{h}}}]] }} | Unknown }} </td></tr> }}
<tr>
+
{{#if: {{{px|}}} | <tr>
<th> Discovered by </th>
+
<th> Period multiplier </th>
<td> {{#if: {{{discoverer|}}} | [[:Category:Patterns_found_by_{{{discoverer|}}}|{{{discoverer|}}}]] | Unknown }} </td></tr>
+
<td> {{#if: {{{px|}}} | {{#switch: {{{px|}}}  
<tr>
+
    | 2 = [[:Category:Period-doubling reflectors|2×]]
<th> Year of discovery </th>
+
    | 3 = [[:Category:Period-tripling reflectors|3×]]
<td> {{#if: {{{discoveryear|}}} | [[:Category:Patterns_found_in_{{{discoveryear|}}}|{{{discoveryear|}}}]] | Unknown }} </td></tr>{{PatternDownload|synthesis={{{synthesis|}}}|synthesisRLE={{{synthesisRLE|}}}|life105={{{life105|}}}|life106={{{life106|}}}|plaintext={{{plaintext|}}}|mc={{{mc|}}}|rle={{{rle|}}}|pname={{{pname|}}}|rulespecial={{{rulespecial|}}}|rulemax={{{rulemax|}}}|rulemin={{{rulemin|}}} }} </table>
+
    | 4 = [[:Category:Period-quadrupling reflectors|4×]]
<noinclude>__NOTOC__
+
    | 5 = [[:Category:Period-quintupling reflectors|5×]]
This is an infobox template for '''[[reflector]]s'''. An example can be seen to the right. For general information about how to use pattern templates, see [[LifeWiki:Style guide/Pattern layout]]. To see a live example of this template in action, see [[buckaroo]].
+
    | {{{px|}}}×
 +
}} }}
 +
</tr>}}{{#if: {{{colour|{{{color|}}}}}} | <tr>
 +
<th> Colour </th>
 +
<td> {{#switch: {{lc:{{{colour|{{{color}}}}}}}}
 +
    | preserving
 +
    | preserves
 +
    | preserve
 +
    | cp        = [[:Category:Colour-preserving reflectors|Colour-preserving]]
 +
    | changing
 +
    | changes
 +
    | change
 +
    | cc        = [[:Category:Colour-preserving reflectors|Colour-changing]]
 +
}} </td>
 +
</tr>}}<!--
 +
 
 +
Display an infobox divider
 +
 
 +
-->{{InfoboxDivider}}<!--
 +
 
 +
Display discoverers and year of discovery
 +
 
 +
-->{{PatternDiscovery
 +
|discoverer  = {{{discoverer|}}}
 +
|discoverer2  = {{{discoverer2|}}}
 +
|discoverer3  = {{{discoverer3|}}}
 +
|discoverer4  = {{{discoverer4|}}}
 +
|discoverer5  = {{{discoverer5|}}}
 +
|discoveryear = {{{discoveryear|}}}
 +
}}<!--
 +
 
 +
Display "Rules", "Glider synthesis", "Pattern files" sections
 +
 
 +
-->{{PatternDownload
 +
|synthesis   = {{{synthesis|}}}
 +
|synthesisRLE = {{{synthesisRLE|}}}
 +
|apgcode      = {{{apgcode|}}}
 +
|life105     = {{{life105|}}}
 +
|life106     = {{{life106|}}}
 +
|plaintext   = {{{plaintext|}}}
 +
|zip          = {{{zip|}}}
 +
|mc           = {{{mc|}}}
 +
|rle         = {{{rle|}}}
 +
|pname       = {{{pname|}}}
 +
|rulespecial = {{{rulespecial|}}}
 +
|rulemax     = {{{rulemax|}}}
 +
|rulemin     = {{{rulemin|}}}  
 +
|isorulemax  = {{{isorulemax|}}}
 +
|isorulemin  = {{{isorulemin|}}}
 +
}}<!--
 +
 
 +
Display "Identifiers" section
 +
 
 +
-->{{PatternIdentifiers
 +
|apgcode          = {{{apgcode|}}}
 +
|niemiecid        = {{{niemiecid|}}}
 +
|pentadecathlonid = {{{pentadecathlonid|}}}
 +
}}<!--
 +
 
 +
End infobox
  
''Note:'' This template was only designed for glider reflectors. If other types of reflectors are to be included then the template will need to be updated to provide this information.
+
--></table><!--
  
===Special Parameters===
+
Transcluded documentation
*'''type''': only supports "stable"; if it is an oscillating reflector leave this parameter undefined.
 
*'''p''': is simply the period of an oscillating reflector; however, for [[stable reflector]]s this is the [[Stable_reflector#Repeat_time|repeat time]].
 
*'''a''': is the angle of the output glider in relation to the input glider (should be one of two values: 90 or 180).
 
*'''isosc''': tells whether the reflector can function as an oscillator on its own (some reflectors require a constant stream of gliders). If the pattern can not function as an oscillator on its own this parameter should be "false", otherwise leave it undefined.
 
  
===Images===
+
--><noinclude>{{Reflector/Doc}}
The image in this infobox should '''NOT''' include the glider that is to be reflected (except in the case of reflectors that require a constant stream of gliders); this can be added below in an image gallery. The animation for an oscillating reflector should '''NOT''' show the reflection capabilities of the pattern but merely the oscillator itself (except in the case of patterns that need a constant stream of gliders). Stable reflectors should not have an animated image in this infobox. Instead, an animation of the reflection capabilities (for both stable and oscillating reflectors) can be ''linked to'' in the image gallery. Do '''NOT''' place animated images directly onto the page; instead, consider using a static image of the reflector with a caption that links to the animation. An example is shown below:
+
{{PatternTemplates}}
 +
</noinclude><!--
  
==Example image gallery==
+
Categories
{|
 
|-
 
|[[Image:Buckarooprereflection.png|framed|left|A [[buckaroo]] reflecting a glider<br />[[Media:Buckarooreflect.gif|View animated image]] ]]
 
|}
 
  
{{PatternTemplates}}</noinclude>
+
--><includeonly>
<includeonly>
+
{{#ifeq:{{NAMESPACE}}|User||
 
[[Category:Patterns]]
 
[[Category:Patterns]]
 
[[Category:Reflectors]]
 
[[Category:Reflectors]]
{{#ifeq: {{lc:{{{type|}}}}} | stable | [[Category:Stable_reflectors]] |{{#ifeq:{{lc:{{{isosc|}}}}}|false||[[Category:Oscillators]] {{#if: {{{h|}}} | {{#iferror: {{#expr: floor({{{h}}})}} | | [[Category:Oscillators with heat {{#expr: floor({{{h}}})}}]] }} }} }} {{#if: {{{p|}}} | {{#ifeq:{{lc:{{{isosc|}}}}}|false||[[Category:Oscillators_with_period_{{{p}}}]]}} }} }}{{#if: {{{c|}}} | {{#ifexpr: {{{c|}}} >= 1000 | [[Category:Patterns with 1000 or more cells|{{{c}}}]] | [[Category:Patterns with {{{c}}} cells|{{{c}}}]] }} }}{{#if: {{{a|}}} | [[Category:{{{a}}}_degree_reflectors]]}}{{#if: {{{discoverer|}}} | [[Category:Patterns found by {{{discoverer|}}}]] }}{{#if: {{{discoveryear|}}} | [[Category:Patterns found in {{{discoveryear|}}}]] }}
+
{{#ifeq: {{lc:{{{type|}}}}} | stable | [[Category:Stable reflectors]] |{{#ifeq:{{lc:{{{isosc|}}}}}|false||[[Category:Oscillators]] {{#if: {{{h|}}} | {{#iferror: {{#expr: floor({{{h}}})}} | | [[Category:Oscillators with heat {{#expr: floor({{{h}}})}}]] }} }} }} {{#if: {{{p|}}} | {{#ifeq:{{lc:{{{isosc|}}}}}|false||[[Category:Oscillators with period {{{p}}}]]}} }} }}{{#if: {{{a|}}} | [[Category:{{{a}}} degree reflectors]]}}{{#if: {{{px|}}} | {{#switch: {{{px|}}} | 2 = [[Category:Period-doubling reflectors]] | 3 = [[Category:Period-tripling reflectors]] | 4 = [[Category:Period-quadrupling reflectors]] | 5 = [[Category:Period-quintupling reflectors]] }} }}{{#if: {{{colour|}}} | {{#switch: {{lc:{{{colour|{{{color}}}}}}}} | preserving | preserves | preserve | cp = [[Category:Colour-preserving reflectors]] | changing | changes | change | cc = [[Category:Colour-changing reflectors]] }} }}
</includeonly>
+
}}</includeonly>

Latest revision as of 19:53, 5 December 2019

Reflector Name
image
Pattern type Reflector
Oscillator
Angle Unknown
Period Unknown
Heat Unknown
Discovered by Unknown
Year of discovery Unknown

This is an infobox template for reflectors. An example can be seen to the right. For general information about how to use pattern templates, see LifeWiki:Style guide/Pattern layout. To see a live example of this template in action, see buckaroo.

Note: This template was only designed for glider reflectors. If other types of reflectors are to be included then the template will need to be updated to provide this information.

Special Parameters

  • type: only supports "stable"; if it is an oscillating reflector leave this parameter undefined.
  • p: is simply the period of an oscillating reflector; however, for stable reflectors this is the repeat time.
  • a: is the angle of the output glider in relation to the input glider (should be one of two values: 90 or 180).
  • px: is the period multiplier of the reflector, e.g. "4" for the Quadri-Snark.
  • colour: indicates whether the reflector preserves or changes a glider's colour.
  • isosc: tells whether the reflector can function as an oscillator on its own (some reflectors require a constant stream of gliders). If the pattern can not function as an oscillator on its own this parameter should be "false", otherwise leave it undefined.

Images

The pattern in this infobox should include the glider that is to be reflected -- optionally, two input gliders separated by the mechanism's minimum recovery time, and an output glider if that allows a smoother LifeViewer animation. However, the bounding box and population count should be calculated with these gliders removed.

If animations are needed, a LifeViewer thumbnail is often a good solution, since it allows the pattern information to be copied directly from LifeViewer if needed. A LifeViewer thumbnail example is shown below. Please do not place animated GIF images directly onto the page; instead, consider using a static image of the reflector with a caption that links to the animation. An example static image is shown below. LifeViewer can also produce static images, simply by leaving out the AUTOSTART keyword from the associated viewerconfig string.

Example image gallery

A buckaroo reflecting a glider
View animated image
x = 27, y = 17, rule = B3/S23 8b3o$8bo17bo$9bo14b2o$25b2o5$9bo$7bobo$6bobo$2o3bo2bo$2o4bobo$7bobo9b 2o$9bo9bobo$21bo$21b2o! #C [[ THUMBSIZE 2 THEME 6 GRID GRIDMAJOR 0 SUPPRESS THUMBLAUNCH ]] #C [[ AUTOSTART THUMBSIZE 2 HEIGHT 320 WIDTH 480 X -2 Z 16 GPS 10 LOOP 60 ]]
A buckaroo reflecting a glider,
LifeViewer thumbnail version
(click above to open LifeViewer)
RLE: here Plaintext: here

Pattern templates