Bureaucrats, Interface administrators, Administrators (Semantic MediaWiki), Curators (Semantic MediaWiki), Editors (Semantic MediaWiki), Administrators
10,686
edits
Line 2: | Line 2: | ||
| 0 = at target, | | 0 = at target, | ||
|#default = {{#expr:abs({{#var:range o|}})}} square(s) {{#ifexpr: {{#var:range o|}} > 0 |in front of|behind}} target, | |#default = {{#expr:abs({{#var:range o|}})}} square(s) {{#ifexpr: {{#var:range o|}} > 0 |in front of|behind}} target, | ||
}} {{#ifexpr:{{#var:range d}} != 0 and {{#var:range d}} = {{#var:range h}} and {{#var:range h}} = {{#var:range v}} |in a {{#var:range d}} square radius|{{#switch:{{#var:range h|}} | }} {{#ifexpr:{{#var:range d}} != 0 and {{#var:range d}} = {{#var:range h}} and {{#var:range h}} = {{#var:range v}} |in a {{#var:range d}} square radius | ||
|{{#ifexpr: {{#var:range h}} != 0 and {{#var:range h}} = {{#var:range v}} |{{#switch:{{#var:range h|}} | |||
| 0 = directly adjacent, | |||
| #default = {{#var:range h}} squares away horizontally and vertically, | |||
}}|{{#switch:{{#var:range h|}} | |||
| 0 = | | 0 = | ||
| 1 = horizontally adjacent, | | 1 = horizontally adjacent, | ||
Line 10: | Line 14: | ||
| 1 = vertically adjacent, | | 1 = vertically adjacent, | ||
|#default = {{#var:range v|}} squares vertically, | |#default = {{#var:range v|}} squares vertically, | ||
}} {{#switch:{{#var:range d|}} | }}}} {{#switch:{{#var:range d|}} | ||
| 0 = . | | 0 = . | ||
| 1 = diagonally. | | 1 = diagonally. | ||
Line 18: | Line 22: | ||
#vardefine:range|{{#replace:{{#var:range}}|,.|.}}}}{{ | #vardefine:range|{{#replace:{{#var:range}}|,.|.}}}}{{ | ||
#var:range}}</onlyinclude></includeonly> | #var:range}}</onlyinclude></includeonly> | ||
== Description == | |||
Parses a string in the format of [distance] [horizontal] [vertical] [diagonal] into something mostly human readable. | |||
== Examples == | == Examples == |