<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ACheck_winner_by_scores</id>
	<title>Module:Check winner by scores - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ACheck_winner_by_scores"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Check_winner_by_scores&amp;action=history"/>
	<updated>2026-04-09T06:26:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Check_winner_by_scores&amp;diff=135558&amp;oldid=prev</id>
		<title>imported&gt;Legoktm: Replace Module:No globals with require( &quot;strict&quot; )</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Check_winner_by_scores&amp;diff=135558&amp;oldid=prev"/>
		<updated>2022-10-21T21:13:41Z</updated>

		<summary type="html">&lt;p&gt;Replace &lt;a href=&quot;/research/Module:No_globals&quot; title=&quot;Module:No globals&quot;&gt;Module:No globals&lt;/a&gt; with require( &amp;quot;strict&amp;quot; )&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require(&amp;#039;strict&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function format_score(s)&lt;br /&gt;
	s = mw.ustring.gsub(s or &amp;#039;&amp;#039;, &amp;#039;^[%s\&amp;#039;]*([%d%.]+)[%s\&amp;#039;]*[–−—%-][%s\&amp;#039;]*([%d%.]+)&amp;#039;, &amp;#039;%1–%2&amp;#039;)&lt;br /&gt;
	s = mw.ustring.gsub(s, &amp;#039;^%s*([%d%.]+)%s*&amp;amp;[MmNn][Dd][Aa][Ss][Hh];%s*([%d%.]+)&amp;#039;, &amp;#039;%1–%2&amp;#039;)&lt;br /&gt;
	s = mw.ustring.gsub(s, &amp;#039;^%s*(%[%[[^%[%]]*%|[%d%.]+)%s*%-%s*([%d%.]+)&amp;#039;, &amp;#039;%1–%2&amp;#039;)&lt;br /&gt;
	s = mw.ustring.gsub(s, &amp;#039;^%s*(%[[^%[%]%s]*%s+[%d%.]+)%s*%-%s*([%d%.]+)&amp;#039;, &amp;#039;%1–%2&amp;#039;)&lt;br /&gt;
	s = mw.ustring.gsub(s, &amp;#039;^%s*(%[%[[^%[%]]*%|[%d%.]+)%s*&amp;amp;[MmNn][Dd][Aa][Ss][Hh];%s*([%d%.]+)&amp;#039;, &amp;#039;%1–%2&amp;#039;)&lt;br /&gt;
	s = mw.ustring.gsub(s, &amp;#039;^%s*(%[[^%[%]%s]*%s+[%d%.]+)%s*&amp;amp;[MmNn][Dd][Aa][Ss][Hh];%s*([%d%.]+)&amp;#039;, &amp;#039;%1–%2&amp;#039;)&lt;br /&gt;
	return s&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
	local args = getArgs(frame, { parentFirst = true })&lt;br /&gt;
	local n1 = args[1] or &amp;#039;X&amp;#039;&lt;br /&gt;
	local n2 = args[2] or &amp;#039;X&amp;#039;&lt;br /&gt;
	local s  = args[&amp;#039;sc&amp;#039;] or (n1..&amp;#039;–&amp;#039;..n2)&lt;br /&gt;
&lt;br /&gt;
	s = format_score(s)&lt;br /&gt;
	&lt;br /&gt;
    -- following codes obtained from Module:Sports results&lt;br /&gt;
	-- delink if necessary&lt;br /&gt;
	if s:match(&amp;#039;^%s*%[%[[^%[%]]*%|([^%[%]]*)%]%]&amp;#039;) then&lt;br /&gt;
		s = s:match(&amp;#039;^%s*%[%[[^%[%]]*%|([^%[%]]*)%]%]&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	if s:match(&amp;#039;^%s*%[[^%[%]%s]*%s([^%[%]]*)%]&amp;#039;) then&lt;br /&gt;
		s = s:match(&amp;#039;^%s*%[[^%[%]%s]*%s([^%[%]]*)%]&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- get the scores&lt;br /&gt;
	local s1 = tonumber(mw.ustring.gsub( s or &amp;#039;&amp;#039;,&lt;br /&gt;
		&amp;#039;^%s*([%d][%d%.]*)%s*–%s*([%d][%d%.]*).*&amp;#039;, &amp;#039;%1&amp;#039; ) or nil)&lt;br /&gt;
		or mw.ustring.gsub(s or &amp;#039;&amp;#039;, &amp;#039;^([WL]*)–([WL]*).*&amp;#039;, &amp;#039;%1&amp;#039; )&lt;br /&gt;
		or &amp;#039;&amp;#039;&lt;br /&gt;
	local s2 = tonumber(mw.ustring.gsub( s or &amp;#039;&amp;#039;,&lt;br /&gt;
		&amp;#039;^%s*([%d][%d%.]*)%s*–%s*([%d][%d%.]*).*&amp;#039;, &amp;#039;%2&amp;#039; ) or nil)&lt;br /&gt;
		or mw.ustring.gsub(s or &amp;#039;&amp;#039;, &amp;#039;^([WL]*)–([WL]*).*&amp;#039;, &amp;#039;%2&amp;#039; )&lt;br /&gt;
		or &amp;#039;&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
	if type(s1) == &amp;#039;number&amp;#039; and type(s2) == &amp;#039;number&amp;#039; then&lt;br /&gt;
		return (s1 &amp;gt; s2) and &amp;#039;W&amp;#039; or ((s2 &amp;gt; s1) and &amp;#039;L&amp;#039; or &amp;#039;T&amp;#039;)&lt;br /&gt;
	elseif s1:match(&amp;#039;[WL]&amp;#039;) and s2:match(&amp;#039;[WL]&amp;#039;) and s1 ~= s2 then&lt;br /&gt;
		return s1&lt;br /&gt;
	else&lt;br /&gt;
		return string.format(&amp;quot;&amp;#039;&amp;#039;%s&amp;#039;&amp;#039;&amp;quot;, &amp;#039;Result unknown&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Legoktm</name></author>
	</entry>
</feed>