Difference between revisions of "Template:Curse"

From Co-Optitude Wiki
Jump to navigation Jump to search
 
(13 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
{{Curse|heck}}
 
{{Curse|heck}}
 
</pre>
 
</pre>
</noinclude>
+
</noinclude><includeonly><!--
<includeonly>
+
-->{{#vardefine:curseLower|{{lc:{{{1}}}}}}}<!--
{{#vardefine:curseLower|{{lc:{{{1}}}}}}}
+
-->{{#vardefine:cursePrefixLen|1}}<!--
{{#vardefine:cursePrefixLen|{{#ifeq:{{#sub:{{#var:curseLower}}|0|2}}|sh|2|1}}}}
+
-->{{#ifeq:{{#sub:{{#var:curseLower}}|0|7}}|motherf|{{#vardefine:cursePrefixLen|7}}}}<!--
{{#vardefine:curseSuffixLen|1}}
+
-->{{#ifeq:{{#sub:{{#var:curseLower}}|0|6}}|bullsh|{{#vardefine:cursePrefixLen|6}}}}<!--
{{#ifeq:{{#sub:{{#var:curseLower}}|-3}}|ing|{{#vardefine:curseSuffixLen|3}}}}
+
-->{{#ifeq:{{#sub:{{#var:curseLower}}|0|5}}|dumbf|{{#vardefine:cursePrefixLen|5}}}}<!--
{{#vardefine:cursePrefix:{{#sub:{{{1}}}|0|{{#var:cursePrefixLen}}}}}}
+
-->{{#ifeq:{{#sub:{{#var:curseLower}}|0|2}}|sh|{{#vardefine:cursePrefixLen|2}}}}<!--
{{#vardefine:curseSuffix:{{#sub:{{{1}}}|-{{#var:curseSuffixLen}}}}}}
+
-->{{#vardefine:curseSuffixLen|1}}<!--
{{#vardefine:curseMiddle:{{#sub:{{{1}}}|{{#var:cursePrefixLen}}|-{{#var:curseSuffixLen}}}}}}
+
-->{{#ifeq:{{#sub:{{#var:curseLower}}|-7}}|goddamn|{{#vardefine:curseSuffixLen|4}}}}<!--
 
+
-->{{#ifeq:{{#sub:{{#var:curseLower}}|-4}}|head|{{#vardefine:curseSuffixLen|4}}}}<!--
 +
-->{{#ifeq:{{#sub:{{#var:curseLower}}|-4}}|hole|{{#vardefine:curseSuffixLen|4}}}}<!--
 +
-->{{#ifeq:{{#sub:{{#var:curseLower}}|-4}}|face|{{#vardefine:curseSuffixLen|4}}}}<!--
 +
-->{{#ifeq:{{#sub:{{#var:curseLower}}|-4}}|shit|{{#vardefine:curseSuffixLen|0}}}}<!--
 +
-->{{#ifeq:{{#sub:{{#var:curseLower}}|-3}}|ing|{{#vardefine:curseSuffixLen|3}}}}<!--
 +
-->{{#ifeq:{{#sub:{{#var:curseLower}}|-3}}|est|{{#vardefine:curseSuffixLen|3}}}}<!--
 +
-->{{#ifeq:{{#sub:{{#var:curseLower}}|-3}}|ass|{{#vardefine:curseSuffixLen|0}}}}<!--
 +
-->{{#ifeq:{{#sub:{{#var:curseLower}}|-2}}|ch|{{#vardefine:curseSuffixLen|2}}}}<!--
 +
-->{{#ifeq:{{#sub:{{#var:curseLower}}|-2}}|ed|{{#vardefine:curseSuffixLen|2}}}}<!--
 +
-->{{#ifeq:{{#sub:{{#var:curseLower}}|-2}}|er|{{#vardefine:curseSuffixLen|2}}}}<!--
 +
-->{{#ifeq:{{#var:curseLower}}|shit|{{#vardefine:curseSuffixLen|0}}}}<!--
 +
-->{{#vardefine:cursePrefix|{{#sub:{{{1}}}|0|{{#var:cursePrefixLen}}}}}}<!--
 +
-->{{#vardefine:curseSuffix|{{#ifeq:{{#var:curseSuffixLen}}|0||{{#sub:{{{1}}}|{{#expr:-1*{{#var:curseSuffixLen}}}}}}}}}}<!--
 +
-->{{#vardefine:curseMiddle|{{#sub:{{{1}}}|{{#var:cursePrefixLen}}|{{#expr:-1*{{#var:curseSuffixLen}}}}}}}}<!--
 +
Debug:
 
* 1 = {{{1}}}
 
* 1 = {{{1}}}
 
* curseLower = {{#var:curseLower}}
 
* curseLower = {{#var:curseLower}}
Line 21: Line 35:
 
* curseMiddle = {{#var:curseMiddle}}
 
* curseMiddle = {{#var:curseMiddle}}
 
* curseSuffix = {{#var:curseSuffix}}
 
* curseSuffix = {{#var:curseSuffix}}
 
+
--><span class="rsCurse"><!--
<span class="rsCurse"><span class="rsCursePrefix">{{#var:cursePrefix}}</span><span class="rsCurseMiddle">{{#var:curseMiddle}}</span><span class="rsCurseSuffix">{{#var:curseSuffix}}</span></span>
+
  --><span class="rsCursePrefix">{{#var:cursePrefix}}</span><!--
</includeonly>
+
  --><span class="rsCurseMiddle">{{#var:curseMiddle}}</span><!--
 +
  --><span class="rsCurseSuffix">{{#var:curseSuffix}}</span><!--
 +
--></span><!--
 +
--></includeonly>

Latest revision as of 19:43, 9 May 2020

Usage example:

{{Curse|heck}}