You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
427 B
TypeScript
18 lines
427 B
TypeScript
export function tiShortChoser(
|
|
tBlue: number,
|
|
tRed: number,
|
|
sBlue: number,
|
|
sRed: number,
|
|
) {
|
|
let tishort = tBlue > tRed ? tRed + 1 : tBlue + 1;
|
|
let socks = sBlue > sRed ? sRed + 1 : sBlue + 1;
|
|
|
|
if (tBlue === tRed) tishort = tRed + 1;
|
|
if (sBlue === sRed) socks = sRed + 1;
|
|
|
|
if (tBlue === tRed && tBlue === 1) tishort = 2;
|
|
if (sBlue === sRed && sBlue === 1) socks = 2;
|
|
|
|
return [tishort, socks].join(" ");
|
|
}
|