Skip to main content
added 259 characters in body
Source Link
Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61

Husk, 5 bytes

±ḟIz- 

Try it online!

Input as lists of digits, output as -1 (first wins), 0 (neither wins) or 1 second wins.
Would be 1-byte shorter to output negative, zero or positive, but Husk doesn't have a 3-way comparison operator so it seems this is ruled-out...

 z # zip digits from each pair of inputs together - # by subtraction, ḟ # get the first element that is I # itself truthy (non-zero), ± # output the sign of that (-1 or 1) or zero if it's empty 

Husk, 5 bytes

±ḟIz- 

Try it online!

 z # zip digits from each pair of inputs together - # by subtraction, ḟ # get the first element that is I # itself truthy (non-zero), ± # output the sign of that (-1 or 1) or zero if it's empty 

Husk, 5 bytes

±ḟIz- 

Try it online!

Input as lists of digits, output as -1 (first wins), 0 (neither wins) or 1 second wins.
Would be 1-byte shorter to output negative, zero or positive, but Husk doesn't have a 3-way comparison operator so it seems this is ruled-out...

 z # zip digits from each pair of inputs together - # by subtraction, ḟ # get the first element that is I # itself truthy (non-zero), ± # output the sign of that (-1 or 1) or zero if it's empty 
Post Undeleted by Dominic van Essen
Post Deleted by Dominic van Essen
Source Link
Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61

Husk, 5 bytes

±ḟIz- 

Try it online!

 z # zip digits from each pair of inputs together - # by subtraction, ḟ # get the first element that is I # itself truthy (non-zero), ± # output the sign of that (-1 or 1) or zero if it's empty