Template:Jam occurrence leaderboard/query: Difference between revisions

From VNDev Wiki
most of a conversion to use /prop; simplified code
use /tiecalc, simplify code
Line 11: Line 11:
|offset={{#expr: {{{1}}}-1}}
|offset={{#expr: {{{1}}}-1}}
|named args=yes
|named args=yes
<!-- The below section calculates the correct rank number by comparing to prior items  -->
|userparam={{{Jam occurrence leaderboard/tiecalc|rank={{{1}}}|date={{{date|}}} | vnOnly={{{vnOnly|}}} | for={{{for}}}}}}
|userparam={{#ifexpr: {{{1}}} = 1 | 1 |
    {{#ifexpr: {{Jam occurrence leaderboard/prop | date={{{date|}}} | vnOnly={{{vnOnly|}}} | for={{{for}}} | offset={{#expr: {{{1}}}-1}} }}
      = {{Jam occurrence leaderboard/prop | date={{{date|}}} | vnOnly={{{vnOnly|}}} | for={{{for}}} | offset={{#expr: {{{1}}}-2}} }}
      | <!--At least two way tie; now test for three way tie-->
        {{#ifexpr: {{Jam occurrence leaderboard/prop | date={{{date|}}} | vnOnly={{{vnOnly|}}} | for={{{for}}} | offset={{#expr: {{{1}}}-1}} }}
          = {{Jam occurrence leaderboard/prop | date={{{date|}}} | vnOnly={{{vnOnly|}}} | for={{{for}}} | offset={{#expr: {{{1}}}-3}} }}
          | {{#expr: {{{1}}}-2}} (tie)
          | {{#expr: {{{1}}}-1}} (tie)
        }} <!--end if for three-way tie-->
      | <!--Not a tie or is first instance of a tie. Now test if tied with next item.-->
        {{#ifexpr: {{Jam occurrence leaderboard/prop | date={{{date|}}} | vnOnly={{{vnOnly|}}} | for={{{for}}} | offset={{#expr: {{{1}}}-1}} }}
        = {{Jam occurrence leaderboard/prop | date={{{date|}}} | vnOnly={{{vnOnly|}}} | for={{{for}}} | offset={{{1}}} }}
          | {{{1}}} (tie)
          | {{{1}}}
        }} <!--end if for first item of tie-->
    }} <!--end if for two-way tie-->
  }} <!--end if for param is 1-->
}}
}}

Revision as of 08:43, 25 January 2025