Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Module:Sports table/totalscheck

Permanently protected module
From Wikipedia, the free encyclopedia
<Module:Sports table
Module documentation[view] [edit] [history] [purge]
WarningThis Lua module is used onapproximately 50,000 pages and changes may be widely noticed. Test changes in the module's/sandbox or/testcases subpages, or in your ownmodule sandbox. Consider discussing changes on thetalk page before implementing them.
Page template-protectedThis module is currentlyprotected from editing.
See theprotection policy andprotection log for more details. Please discuss any changes on thetalk page; you maysubmit an edit request to ask anadministrator to make an edit if it isuncontroversial or supported byconsensus. You may alsorequest that this page be unprotected.

Usage

{{#invoke:Sports table/totalscheck|function_name}}

The abovedocumentation istranscluded fromModule:Sports table/totalscheck/doc.(edit |history)
Editors can experiment in this module's sandbox(create |mirror) and testcases(create) pages.
Subpages of this module.

localtc={}functiontc.check(Args,team_list,ii_start,ii_end)localwarn={}localwtotal,dtotal,ltotal=0,0,0localhwtotal,hdtotal,hltotal=0,0,0localawtotal,adtotal,altotal=0,0,0localpkwtotal,pkltotal,otwtotal,otltotal=0,0,0,0localgftotal,gatotal=0,0forii=ii_start,ii_enddo-- First get codelocalteam_code_ii=team_list[ii]ifteam_code_ii~='SPORTS_TABLE_TOTAL'then-- Now tabulate valueswtotal=wtotal+(tonumber(Args['win_'..team_code_ii])or0)dtotal=dtotal+(tonumber(Args['draw_'..team_code_ii])or0)ltotal=ltotal+(tonumber(Args['loss_'..team_code_ii])or0)hwtotal=hwtotal+(tonumber(Args['hwin_'..team_code_ii])or0)hdtotal=hdtotal+(tonumber(Args['hdraw_'..team_code_ii])or0)hltotal=hltotal+(tonumber(Args['hloss_'..team_code_ii])or0)awtotal=awtotal+(tonumber(Args['awin_'..team_code_ii])or0)adtotal=adtotal+(tonumber(Args['adraw_'..team_code_ii])or0)altotal=altotal+(tonumber(Args['aloss_'..team_code_ii])or0)pkwtotal=pkwtotal+(tonumber(Args['PKwin_'..team_code_ii])or0)pkltotal=pkltotal+(tonumber(Args['PKloss_'..team_code_ii])or0)otwtotal=otwtotal+(tonumber(Args['OTwin_'..team_code_ii])or0)otltotal=otltotal+(tonumber(Args['OTloss_'..team_code_ii])or0)gftotal=gftotal+(tonumber(Args['gf_'..team_code_ii])or0)+(tonumber(Args['pf_'..team_code_ii])or0)gatotal=gatotal+(tonumber(Args['ga_'..team_code_ii])or0)+(tonumber(Args['pa_'..team_code_ii])or0)endendifwtotal~=ltotalthentable.insert(warn,wtotal..' total wins != '..ltotal..' total losses')endifhwtotal~=altotalthentable.insert(warn,hwtotal..' total hwins != '..altotal..' total alosses')endifawtotal~=hltotalthentable.insert(warn,awtotal..' total awins != '..hltotal..' total hlosses')endif(2*math.floor(dtotal/2))~=dtotalthentable.insert(warn,dtotal..' total draws is an odd number')endifhdtotal~=adtotalthentable.insert(warn,hdtotal..' total hdraw != '..adtotal..' total adraw')endifpkwtotal~=pkltotalthentable.insert(warn,pkwtotal..' total PKwins != '..pkltotal..' total PKlosses')endifotwtotal~=otltotalthentable.insert(warn,otwtotal..' total OTwins != '..otltotal..' total OTlosses')endifgftotal~=gatotalthentable.insert(warn,gftotal..' total for != '..gatotal..' total against')endreturnwarnendreturntc
Retrieved from "https://en.wikipedia.org/w/index.php?title=Module:Sports_table/totalscheck&oldid=1039155130"
Category:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp