[edit] Template-info Template documentation

This is the {{Common boxes an}} template. It calculates statistical values based on WikiProject Statistics data of the most common boxes in Asphalt Nitro. Its behaviour is controlled by a single unnamed parameter.


{{common boxes an | <behaviour>}}


Number of boxes

{{common boxes an|boxes}} → 10

  • boxes simply returns the number of the most common boxes on which the other calculations are based.
  • The number is hard wired in the template code and must be adapted if boxes are added or removed.
  • Inexpensive (calls no other templates).

Number of cards

{{common boxes an|cards}} → 1,051

  • cards calculates and returns the total number of cards of the most common boxes.
  • The number is returned with thousands separators. For further calculations with #expr:, separators have to be removed with {{formatnum:{{common boxes an|cards}}|R}}.
  • Very expensive. {{Common boxes an}} calls all 10 box templates which each call {{Anbox-meta}} to extract the value. Total template calls: 21.


{{common boxes an|list}}

  • list displays a list of the most common boxes together with the cards from each box.
  • Extremely expensive. Template calls:
    • {{Common boxes an}} calls 2x 10 box templates,
    • each of the 2x 10 box templates calls {{Anbox-meta}},
    • half of the {{Anbox-meta}} templates call {{Anbox inline}} to display the box.
    • Total template calls: 51.

Weighted average

{{common boxes an|#sv82}} → 1.33

  • #<parameter> calculates the weighted arithmetic mean for any specified parameter name of a Kit Box template with the absolute frequency of the received cards being the weights. The parameter name must be preceded by #. See {{Anbox-meta}} for a complete list of parameter names.
  • The preferred use of this method is to calculate realistic chances of getting cards from Pro Kit Boxes as the weighted average takes into account that some boxes are more frequent than others. The example above displays the weighted average frequency of V8 Engines in percent. Other examples for weighted averages:
    • {{common boxes an|#srare2}} → 27.02 – statistical frequencies of rare cards in percent.
    • {{common boxes an|#sminrare}} → 1.34 – minimum number of rare cards per box.
    • {{common boxes an|#smeanrare}} → 2.41 – average number of rare cards per box.
    • {{common boxes an|#smaxrare}} → 4.23 – maximum number of rare cards per box.
  • Extremely expensive. Template calls:
    • {{Common boxes an}} calls 3x 10 box templates,
    • each of the 3x 10 box templates calls {{Anbox-meta}} to extract the values.
    • Total template calls: 61.
  • Warning: Although it is tempting to use the weighted average option to compare drop rates in tables, more than 49 uses of {{Common boxes an}} on a page are likely to exceed the maximum template include size per page if other templates are also used. The page will then be categorized under Category:Pages where template include size is exceeded. The parsing of the page will stop at the point the include size is exceeded; table rows may not be displayed or calculation errors may appear if the parsing stops in the middle of sub-template calculation calls.

See also

  • {{Anbox-meta}} – list of extractable parameters and further details on single parameter calls
Community content is available under CC-BY-SA unless otherwise noted.