Module talk:Sports table/Archive 2: Difference between revisions

Content deleted Content added
m Archiving 1 discussion(s) from Module talk:Sports table) (bot
m Archiving 1 discussion(s) from Module talk:Sports table) (bot
Line 181:
 
I've been thinking about this a bit more and I'm starting to wonder why these legs are always generated in pairs (e.g. 2/4/6). In the above example, for instance, I'd think that the sixth column of matches doesn't really need to be there.[[User:Tvx1|T]][[User Talk:Tvx1|v]][[Special:Contributions/Tvx1|x]]1 22:39, 29 February 2020 (UTC)
 
== Head to head column ==
 
I have been using the WDL template. In sports that frequently have multiple teams/players tied, it might be more useful to have a separate column for HTH rather than attaching notes to the points column. A hacky way that I have done this is to use
 
<pre>
|rw_header=<abbr title="head-to-head score among tied players">HTH</abbr>
|show_rw=yes
|rwpoints=0
</pre>
with |rw_NAME=1 (or however many points NAME had among tied teams/players)
 
This runs into problems though, especially if |rwpoints=0 gets removed in someone else's edit.
 
Is there a way someone could make an option for a hth column that appears right after the points column? Thanks!
 
The main reason I want one is for Chess tournaments. There is a Chess version of Sports table, but I'm not sure how it works exactly. At least, you can't just convert a WDL table into one, which would be kinda necessary. [[User:NHammen|NHammen]] ([[User talk:NHammen|talk]]) 13:49, 23 March 2020 (UTC)
 
 
I decided to make one in the sandbox for WDL myself. Testing testing:
<onlyinclude>{{#invoke:Sports table|main|style=WDL/sandbox
 
<!-- READ BEFORE EDIT
Please, when updating the standings:
1. Update the rank of the players, using the tiebreaker rules, reordering the rows. (if two players still being tied, use e.g. "4–6" term for the rank, ordering then by current FIDE rating);
2. Update the update date (including UTC time, if the round of the day is not over).
Thank you.
-->
 
<!-- UPDATE DATE -->
 
|update=23 March 2020
 
<!-- SET STANDARDS (don't worry about editing this, when updating). -->
 
|team_header=Player
|postitle = Rank
|for_against_style=none
|res_col_header=Q
|winpoints=1
|drawpoints=0.5
|losspoints=0
 
|pts_first=true
|away_goals_header=<abbr title="Sonneborn–Berger score">SB</abbr>
|show_hth_column=yes
|show_away_goals=yes
|show_matches=true
|source=[https://en.candidates-2020.com/main/#rec164283054/ Official website]
|class_rules= 1) points; 2) head-to-head score among tied players; 3) total number of wins; 4) [[Sonneborn–Berger score]] (SB); 5) tie-break games.
 
<!-- TITLE INFORMATION (when someone has secured the title, uncomment this information).
 
|result1=WC
|col_WC=green1 |text_WC={{nowrap|Advance to [[World Chess Championship 2020#Championship match|title match]]}}
-->
 
<!-- PLAYER NAMES -->
 
|name_NEP={{flagathlete|[[Ian Nepomniachtchi]]|RUS}} |short_NEP=NEP
|name_CAR={{flagathlete|[[Fabiano Caruana]]|USA}} |short_CAR=CAR
|name_GIR={{flagathlete|[[Anish Giri]]|NED}} | short_GIR=GIR
|name_GRI={{flagathlete|[[Alexander Grischuk]]|RUS}} | short_GRI=GRI
|name_ALE={{flagathlete|[[Kirill Alekseenko]]|RUS}} |short_ALE=ALE
|name_MVL={{flagathlete|[[Maxime Vachier-Lagrave]]|FRA}} |short_MVL=MVL
|name_DIN={{flagathlete|[[Ding Liren]]|CHN}} |short_DIN=DIN
|name_WAN={{flagathlete|[[Wang Hao (chess player)|Wang Hao]]|CHN}} |short_WAN=WAN
 
<!-- PLAYER RANKS (to use a special rank for a player, e.g. "4–6" for Caruana, include |pos_CAR=4–6 below) -->
 
|team1=NEP |team2=MVL |team3=CAR |team4=GIR |team5=WAN |team6=GRI |team7=DIN |team8=ALE
|pos_GIR=4–5 |pos_WAN=4–5
 
<!-- OTHER PLAYER INFORMATIONS ("|rw_XXX=" is about the HTH column, and "|away_goals_XXX=" is about the SB column)-->
 
|win_ALE=0 |draw_ALE=4 |loss_ALE=2 |hth_col_ALE=0 |away_goals_ALE=7
|win_CAR=1 |draw_CAR=4 |loss_CAR=1 |hth_col_CAR=1 |away_goals_CAR=9
|win_DIN=1 |draw_DIN=2 |loss_DIN=3 |hth_col_DIN=0 |away_goals_DIN=6
|win_GIR=1 |draw_GIR=4 |loss_GIR=1 |hth_col_GIR=1 |away_goals_GIR=7.75
|win_GRI=0 |draw_GRI=6 |loss_GRI=0 |hth_col_GRI=1 |away_goals_GRI=9
|win_MVL=1 |draw_MVL=5 |loss_MVL=0 |away_goals_MVL=9
|win_NEP=3 |draw_NEP=3 |loss_NEP=0 |away_goals_NEP=12
|win_WAN=1 |draw_WAN=4 |loss_WAN=1 |hth_col_WAN=1 |away_goals_WAN=7.75
 
<!-- MATCHES INFORMATIONS -->
 
|match_NEP_CAR={{color box|White| |Black}}{{color box|Black|½|White}}
|match_NEP_GIR={{color box|White| |Black}}{{color box|Black|1|White}}
|match_NEP_GRI={{color box|White|½|Black}}{{color box|Black| |White}}
|match_NEP_ALE={{color box|White| |Black}}{{color box|Black|½|White}}
|match_NEP_WAN={{color box|White|1|Black}}{{color box|Black| |White}}
|match_NEP_MVL={{color box|White| |Black}}{{color box|Black| |White}}
|match_NEP_DIN={{color box|White|1|Black}}{{color box|Black| |White}}
 
|match_CAR_NEP={{color box|White|½|Black}}{{color box|Black| |White}}
|match_CAR_GIR={{color box|White| |Black}}{{color box|Black|½|White}}
|match_CAR_GRI={{color box|White| |Black}}{{color box|Black|½|White}}
|match_CAR_ALE={{color box|White|1|Black}}{{color box|Black| |White}}
|match_CAR_WAN={{color box|White| |Black}}{{color box|Black| |White}}
|match_CAR_MVL={{color box|White| |Black}}{{color box|Black|½|White}}
|match_CAR_DIN={{color box|White| |Black}}{{color box|Black|0|White}}
 
|match_GIR_NEP={{color box|White|0|Black}}{{color box|Black| |White}}
|match_GIR_CAR={{color box|White|½|Black}}{{color box|Black| |White}}
|match_GIR_GRI={{color box|White| |Black}}{{color box|Black| |White}}
|match_GIR_ALE={{color box|White| |Black}}{{color box|Black|1|White}}
|match_GIR_WAN={{color box|White| |Black}}{{color box|Black|½|White}}
|match_GIR_MVL={{color box|White|½|Black}}{{color box|Black| |White}}
|match_GIR_DIN={{color box|White| |Black}}{{color box|Black|½|White}}
 
|match_GRI_NEP={{color box|White| |Black}}{{color box|Black|½|White}}
|match_GRI_CAR={{color box|White|½|Black}}{{color box|Black| |White}}
|match_GRI_GIR={{color box|White| |Black}}{{color box|Black| |White}}
|match_GRI_ALE={{color box|White|½|Black}}{{color box|Black| |White}}
|match_GRI_WAN={{color box|White|½|Black}}{{color box|Black| |White}}
|match_GRI_MVL={{color box|White| |Black}}{{color box|Black|½|White}}
|match_GRI_DIN={{color box|White|½|Black}}{{color box|Black| |White}}
 
|match_ALE_NEP={{color box|White|½|Black}}{{color box|Black| |White}}
|match_ALE_CAR={{color box|White| |Black}}{{color box|Black|0|White}}
|match_ALE_GIR={{color box|White|0|Black}}{{color box|Black| |White}}
|match_ALE_GRI={{color box|White| |Black}}{{color box|Black|½|White}}
|match_ALE_WAN={{color box|White| |Black}}{{color box|Black|½|White}}
|match_ALE_MVL={{color box|White|½ |Black}}{{color box|Black| |White}}
|match_ALE_DIN={{color box|White| |Black}}{{color box|Black| |White}}
 
|match_WAN_NEP={{color box|White| |Black}}{{color box|Black|0|White}}
|match_WAN_CAR={{color box|White| |Black}}{{color box|Black| |White}}
|match_WAN_GIR={{color box|White|½|Black}}{{color box|Black| |White}}
|match_WAN_GRI={{color box|White| |Black}}{{color box|Black|½|White}}
|match_WAN_ALE={{color box|White|½|Black}}{{color box|Black| |White}}
|match_WAN_MVL={{color box|White|½|Black}}{{color box|Black| |White}}
|match_WAN_DIN={{color box|White| |Black}}{{color box|Black|1|White}}
 
|match_MVL_NEP={{color box|White| |Black}}{{color box|Black| |White}}
|match_MVL_CAR={{color box|White|½|Black}}{{color box|Black| |White}}
|match_MVL_GIR={{color box|White| |Black}}{{color box|Black|½|White}}
|match_MVL_GRI={{color box|White|½|Black}}{{color box|Black| |White}}
|match_MVL_ALE={{color box|White| |Black}}{{color box|Black|½|White}}
|match_MVL_WAN={{color box|White| |Black}}{{color box|Black|½|White}}
|match_MVL_DIN={{color box|White|1|Black}}{{color box|Black| |White}}
 
|match_DIN_NEP={{color box|White| |Black}}{{color box|Black|0|White}}
|match_DIN_CAR={{color box|White|1|Black}}{{color box|Black| |White}}
|match_DIN_GIR={{color box|White|½|Black}}{{color box|Black| |White}}
|match_DIN_GRI={{color box|White| |Black}}{{color box|Black|½|White}}
|match_DIN_ALE={{color box|White| |Black}}{{color box|Black| |White}}
|match_DIN_WAN={{color box|White|0|Black}}{{color box|Black| |White}}
|match_DIN_MVL={{color box|White| |Black}}{{color box|Black|0|White}}
}}
 
<small>'''Note:''' Numbers in the crosstable in a white background indicate the result playing the respective opponent with the white pieces (black pieces if on a black background).</small>
</onlyinclude>
 
Seems to work. How does this get moved from sandbox to main? [[User:NHammen|NHammen]] ([[User talk:NHammen|talk]]) 20:16, 23 March 2020 (UTC)
 
:Nevermind. I got the Chess module table to work. So I don't need this to migrate from sandbox anymore. [[User:NHammen|NHammen]] ([[User talk:NHammen|talk]]) 00:31, 5 April 2020 (UTC)