Difference between revisions of "Template:Alg"

From Speedsolving.com Wiki
(Undo revision 25500 by Martinss (talk))
(Added urlencode to stage parameter to allow stage names with special characters)
 
(7 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
| style="padding: 1px 5px; background: #FFFFFF; width: 18px; border: 1px solid #CCC;" | [[Image:Speedsolving Logo tiny.gif|link=]]
 
| style="padding: 1px 5px; background: #FFFFFF; width: 18px; border: 1px solid #CCC;" | [[Image:Speedsolving Logo tiny.gif|link=]]
 
| style="padding: 0px 5px; background: #F8F8F8; width: 30px; text-align: center; border: 1px solid #CCC;" | {{{stage|{{{2|Alg}}}}}}
 
| style="padding: 0px 5px; background: #F8F8F8; width: 30px; text-align: center; border: 1px solid #CCC;" | {{{stage|{{{2|Alg}}}}}}
| style="padding: 0px 5px; background: #F0F0F0; width: 375px; border: 1px solid #CCC;" | [http://alg.cubing.net/?puzzle={{{puzzle|{{{cube|3x3x3}}}}}}&stage={{{stage|{{{2|full}}}}}}&type=alg&view=playback&alg={{urlencode:{{{alg|{{{1|}}}}}} |PATH}} {{{alg|{{{1|Algorithm}}}}}}]
+
| style="padding: 0px 5px; background: #F0F0F0; width: 375px; border: 1px solid #CCC;" | {{#if: {{{comment|}}} | {{{comment|}}}:}} [http://alg.cubing.net/?puzzle={{{puzzle|{{{cube|3x3x3}}}}}}&stage={{urlencode:{{{stage|{{{2|full}}}}}}}}&type=alg&view=playback&alg={{urlencode:{{{alg|{{{1|}}}}}} |PATH}} {{{alg|{{{1|Algorithm}}}}}}]
| style="padding: 0px 5px; background: #E8E8E8; width: 55px; border: 1px solid #CCC;" | [[Image:Cube_Camera_Icon.png|link={{{vidurl|}}}]] [{{{vidurl|X}}}]
+
| {{#if: {{{vidurl|}}} |style="padding: 0px 5px; background: #E8E8E8; width: 55px; border: 1px solid #CCC;"|}} | {{#if: {{{vidurl|}}} | [[Image:Cube_Camera_Icon.png|link={{{vidurl|}}}]][{{{vidurl|X}}}]|}}
 
|}
 
|}
 
<noinclude>
 
<noinclude>
Line 10: Line 10:
 
==How to add algorithms:==
 
==How to add algorithms:==
  
# Click the 'Edit' tab next to the case and you will have a editor for the wiki-code showing the text of the particular section you choosed.
+
# Click the 'Edit' tab next to the case and you will have a editor for the wiki-code showing the text of the particular section you chose.
 
# Copy-paste the last line that is an alg; <nowiki>{{Alg|R U R U}}</nowiki>, and change the alg to your one.
 
# Copy-paste the last line that is an alg; <nowiki>{{Alg|R U R U}}</nowiki>, and change the alg to your one.
 
# Click 'Show preview' and check everything is ok.
 
# Click 'Show preview' and check everything is ok.
Line 22: Line 22:
 
Basic use:
 
Basic use:
  
<span style="font-family: Courier;"><nowiki>{{Alg|RUR'URU2'R'}}</nowiki></span>
+
<span style="font-family: Courier;"><nowiki>{{Alg|R U R' U R U2' R'}}</nowiki></span>
  
{{Alg|RUR'URU2'R'}}
+
{{Alg|R U R' U R U2' R'}}
  
  
 
If you want, you can specify that this is the alg. If not, the first parameter is assumed to be the alg.
 
If you want, you can specify that this is the alg. If not, the first parameter is assumed to be the alg.
  
<span style="font-family: Courier;"><nowiki>{{Alg|alg=RUR'URU2'R'}}</nowiki></span>
+
<span style="font-family: Courier;"><nowiki>{{Alg|alg=R U R' U R U2' R'}}</nowiki></span>
  
{{Alg|RUR'URU2'R'}}
+
{{Alg|R U R' U R U2' R'}}
  
  
Line 50: Line 50:
  
 
{{Alg | R U R' U' R' F R2 U' R' U' R U R' F' |PLL}}
 
{{Alg | R U R' U' R' F R2 U' R' U' R U R' F' |PLL}}
 
  
 
You can link to a video (currently, only a single video):
 
You can link to a video (currently, only a single video):

Latest revision as of 14:17, 16 December 2020

Speedsolving Logo tiny.gif Alg Algorithm


How to add algorithms:

  1. Click the 'Edit' tab next to the case and you will have a editor for the wiki-code showing the text of the particular section you chose.
  2. Copy-paste the last line that is an alg; {{Alg|R U R U}}, and change the alg to your one.
  3. Click 'Show preview' and check everything is ok.
  4. Click 'Save page' and you are done!

The template

This is an alg template that can be used to link algorithms to an animation and, optionally, a video. The template is very flexible, and its features and functions can be modified without changing the code of the algs on all the pages.

Examples:

Basic use:

{{Alg|R U R' U R U2' R'}}

Speedsolving Logo tiny.gif Alg R U R' U R U2' R'


If you want, you can specify that this is the alg. If not, the first parameter is assumed to be the alg.

{{Alg|alg=R U R' U R U2' R'}}

Speedsolving Logo tiny.gif Alg R U R' U R U2' R'


You can specify the stage of an alg, which is by default the second parameter:

{{Alg| R U' R' U2 R U' R' |stage=OLL}}

OR

{{Alg| R U' R' U2 R U' R' |OLL}}

Speedsolving Logo tiny.gif OLL RUR'URU2R'


Spacing in the alg does not matter:

{{Alg| R U R' U' R' F R2 U' R' U' R U R' F' | PLL}}

Speedsolving Logo tiny.gif PLL R U R' U' R' F R2 U' R' U' R U R' F'


You can link to a video (currently, only a single video):

{{Alg|R U R' U' R' F R2 U' R' U' R U R' F'|PLL|vidurl=http://www.youtube.com/watch?v=kD4SCn60jrc}}

Speedsolving Logo tiny.gif PLL R U R' U' R' F R2 U' R' U' R U R' F' Cube Camera Icon.png[1]