Determine the Winner of a Game of Australian Football

In Australian Football, goals are worth 6 points and behinds are worth 1 point. Scores may include the number of goals and behinds, as well as the total score. Given the number of goals and behinds for two different teams, determine which team won the game.

Take four integers g1, b1, g2, b2 as input, and output two distinct values for whether the first team or the second team inputted won. Input format is flexible, but input order must allow it to be obvious which team is first. For example, g1, g2, b1, b2 would be allowed, but b1, g2, g1, b2 would not.

Test Cases

Test cases will use true for the first team winning and false for the second team winning. Input is in the format (g1,b1),(g2,b2).

(1,0),(0,1)        true
(2,0),(0,11)       true
(10,8),(11,1)      true
(0,0),(1,0)        false
(100,100),(117,0)  false
(7,7),(5,12)       true
(2,0),(0,13)       false


As an example, for input (10,8),(11,1), team 1 scored 10 goals and 8 behinds, for a total of $$\10*6+8*1=68\$$ points, while team 2 scored $$\11*6+1*1=67\$$ points, so team 1 wins.

No input will be a draw - your program's behavior on draw input does not matter.

• Could we extend for Gaelic football and hurling?
– TRiG
Sep 27, 2019 at 10:23
• @TRiG make your own question! Sep 27, 2019 at 11:07
• I'll try to think of something that isn't too close.
– TRiG
Sep 27, 2019 at 11:23
• @TRiG, GAA would be identical, just using base-3 instead of base-6. Sep 27, 2019 at 11:35
• Yeah @Shaggy, which is why I couldn't just copy this question to make an equivalent GAA one. Something similar. Maybe including International Rules Football.
– TRiG
Sep 27, 2019 at 12:15

MathGolf, 7 6 bytes

I am quite impressed that MathGolf has 8 block-starting builtins!

2É6*+>


TIO

Explanation

2      Constant 2
É     Start code block of length 3
6*   Take one input * 6 (with implicit input)
+  Take another input and add them
> Take Greater than of the two constants in the stack
There is an implicit output.


Whitespace, 101 bytes

(Lots of whitespace)

Try it online!

lstl        call readint
sssttsl     push 6
tssl        mult
sssttsl     push 6
tssl        mult
tsst        sub
sssl        push 0
slt         swap
lttsl       jn otherteam
ssstl       push 1
lsssl       otherteam:
tlst        printi
lll         end

sssl        push 0
sls         dup
ttt         retrieve
ltl         ret


R, 28 bytes

function(a,b,c,d)a*6+b>c*6+d


Try it online!

Pyth, 12 bytes

qhQeo+*6hNeN


Try it online!

Pretty simple but Im happy with it. Takes (g1,b1),(g2,b2), returns True or False

How it works

qhQeo+*6hNeN
qhQ          - The first input is equal to..
eo        - The last input of a sorted list (implicitly the input)
+*6hNeN - With the key 6 * first (hN) + last (eN)


GolfScript, 11 bytes

Puts the code block into a function.

{6*+@@6*+>}


Try it online!