text:
Calculate the Ultraradical
What is the Ultraradical?
The ultraradical, or the Bring radical, of a real number \$a\$ is defined as the only real root of the quintic equation \$x^5+x+a=0\$.
Here we use \$\text{UR}(\cdot)\$ to denote the ultraradical function. For example, \$\text{UR}(-100010)=10\$, since \$10^5+10-100010=0\$.
Challenge
Write a full program or a function, that takes a real number as input, and returns or outputs its ultraradical.
Requirements
No standard loopholes are allowed. The results for the test cases below must be accurate to at least 6 significant digits, but in general the program should calculate the corresponding values for any valid real number inputs.
Test Cases
9 decimal places rounded towards 0 are given for reference. Explanation is added for some of the test cases.
 a                         | UR(a)
---------------------------+---------------------
             0             |   0.000 000 000        # 0
             1             |  -0.754 877 (666)      # UR(a) < 0 when a > 0
            -1             |   0.754 877 (666)      # UR(a) > 0 when a < 0
             1.414 213 562 |  -0.881 616 (566)      # UR(sqrt(2))
            -2.718 281 828 |   1.100 93(2 665)      # UR(-e)
             3.141 592 653 |  -1.147 96(5 385)      # UR(pi)
            -9.515 716 566 |   1.515 71(6 566)      # 5th root of 8, fractional parts should match
            10             |  -1.533 01(2 798)
          -100             |   2.499 20(3 570)
         1 000             |  -3.977 89(9 393)
      -100 010             |  10.000 0(00 000)      # a = (-10)^5 + (-10)
 1 073 741 888             | -64.000 0(00 000)      # a = 64^5 + 64

Winning Criteria
The shortest valid submission in every language wins.

Wolfram Language (Mathematica), 20 bytes
Root[xx^5+x+#,1]&

Try it online!
Still a built-in, but at least it isn't UltraRadical.
(the character  is displayed like |-> in Mathematica, similar to => in JS)

I keep wondering why Mathematica uses  and  instead of ↦ and ᵀ

@Adám am I supposed to just see squares for the first two, or am I missing some kind of font...

@mbrig Just squares. That's my point. Mathematica uses characters in the Private Use Areas even though Unicode does have most of them.

Python 3.8 (pre-release), 60 bytes
f=lambda n,x=0:x!=(a:=x-(x**5+x+n)/(5*x**4+1))and f(n,a)or a

Try it online!
Newton iteration method. \$ x' = x - \frac {f(x)} {f'(x)} = x - \frac {x^5+x+n} {5x^4+1}\$
While using \$ \frac {4x^5-n} {5x^4+1} \$ is mathematically equivalent, it makes the program loop forever.

Other approach:
Python 3.8 (pre-release), 102 bytes
lambda x:a(x,-x*x-1,x*x+1)
a=lambda x,l,r:r<l+1e-9and l or(m:=(l+r)/2)**5+m+x>0and a(x,l,m)or a(x,m,r)

Try it online!
Binary search, given that the function x^5+x+a is increasing. Set the bounds to -abs(x) and abs(x) is enough but -x*x-1 and x*x+1 is shorter.
BTW Python's recursion limit is a bit too low so it's necessary to have 1e-9, and the := is called the walrus operator.

Would a linear search take less bytes?

Jelly, 8 bytes
;17B¤ÆrḢ

Try it online!
How it works:

Constructs the list [a, 1, 0, 0, 0, 1] by prepending a to the binary representation of 17. Why this list? Because it corresponds to the coefficients we are looking for:
[a, 1, 0, 0, 0, 1] -> P(x) := a + 1*x^1 + 0*x^2 + 0*x^3 + 0*x^4 + 1*x^5 = a + x + x^5

Then, Ær is a built-in that solves the polynomial equation P(x) = 0, given a list of coefficients (what we constructed earlier).
We are only interested in the real solution, so we take the first entry in the list of solutions with Ḣ.

JavaScript (ES7), 44 bytes
A safer version using the same formula as below but with a fixed number of iterations.
n=>(i=1e3,g=x=>i--?g(.8*x-n/(5*x**4+5)):x)``

Try it online!

JavaScript (ES7),  43  42 bytes
Newton's method, using \$5x^4+5\$ as an approximation of \$f'(x)=5x^4+1\$.
n=>(g=x=>x-(x-=(x+n/(x**4+1))/5)?g(x):x)``

Try it online!
How?
We start with \$x_0=0\$ and recursively compute:
$$x_{k+1}=x_k-\frac{{x_k}^5+x_k+n}{5{x_k}^4+5}=x_k-\frac{x_k+\frac{n}{{x_k}^4+1}}{5}$$
until \$x_k-x_{k+1}\$ is insignificant.

Since comparing equivalence of floating numbers is inaccurate, I am not sure whether the termination of the program can be guaranteed for every possible input (the Python 3 answer below already experienced issues when attempting to shorten the formula).

@Joel I've added a safer version.

APL (Dyalog Unicode), 11 10 bytesSBCS
-1 thanks to dzaima
Anonymous tacit prefix function.
(--*∘5)⍣¯1

Try it online!
(…)⍣¯1 apply the following tacit function negative one time:
 - the negated argument
 - minus
 *∘5 the argument raised to the power of 5
In essence, this asks: Which \$x\$ do I need to feed to \$f(x)=-x-x^5\$ such that the result becomes \$y\$.

This is very cool. Sadly J does not seem able to perform this inversion

@dzaima Why didn't I see that‽ Thank you.

R, 43 bytes
function(a)nlm(function(x)abs(x^5+x+a),a)$e

Try it online!
nlm is an optimization function, so this searches for the minimum of the function \$x\mapsto |x^5+x+a|\$, i.e. the only zero. The second parameter of nlm is the initialization point. Interestingly, initializing at 0 fails for the last test case (presumably because of numerical precision), but initializing at a (which isn't even the right sign) succeeds.

@TheSimpliFire Mathematically, it is equivalent, but numerically, it isn't: using the square instead of the absolute value leads to the wrong value for large input. (Try it online.)

R, 56 bytes
function(x)(y=polyroot(c(x,1,0,0,0,1)))[abs(Im(y))<1e-9]

Try it online!
Thanks to @Roland for pointing out polyroot. I have also realised my previous answer picked a complex root for zero or negative \$a\$ so now rewritten using polyroot and filtering complex roots.

43 bytes

@RobinRyder that’s sufficiently different that I think you should post your own answer. Thanks though!

OK, thanks. Here it is.

"Unfortunately", polyroot returns all complex roots ... Otherwise it would win.

J, 14 bytes
{:@;@p.@,#:@17

Try it online!
J has a built in for solving polynomials... p.
The final 4 test cases timeout on TIO, but in theory are still correct.
how
The polynomial coefficients for J's builtin are taken as a numeric list, with the coefficient for x^0 first.  This means the list is:
a 1 0 0 0 1

1 0 0 0 1 is 17 in binary, so we represent it as #:@17, then append the input ,, then apply p., then unbox the results with raze ;, then take the last element {:

Ruby, 53 41 bytes
->a{x=a/=5;99.times{x-=a/(x**4+1)+x/5};x}

Try it online!
Using Newton-Raphson with a fixed number of iterations, and the same approximation trick as Arnauld

Pari/GP, 34 32 26 24 bytes
a->-solve(X=0,a,a-X-X^5)

Try it online!

Nice answer, but out of curiosity: why does s(-100010) result in -8.090... - 5.877...*I instead of just 10? Is this a limitation of the language for large test cases? PS: You can save 2 bytes changing both 0.2 to .2. :)

Thanks for the tip @KevinCruijssen. The issue is actually for the whole of $\Bbb R^-$, but please see the workaround :)

You can use an anonymous function: a->solve(X=-a,a,X^5+X+a).

Thanks @alephalpha.

k4, 33 31 bytes
{{y-(x+y+*/5#y)%5+5*/4#y}[x]/x}

newton-raphson computed iteratively until a number is converged on
edit: -2 thanks to ngn!

whoops, got this all wrong...
K (oK), 10 bytes
{-x+*/5#x}

@ngn lol, that was careless... updated but now in k4 as i'm too lazy to do it in ngn/k or oK :)

cool! the last pair of [ ] seems unnecessary

hmm, you're right. i've encountered strange behaviour before where over/converge results in an infinite loop because of extraneous/omitted (one or the other, i forget) brackets. that's why i left them in but i should have checked. thanks!

05AB1E, 12 bytes
ΔyIy4m>/+5/-

Try it online!
Newton's method.

Octave, 25 bytes
@(a)fzero(@(x)x^5+x+a,-a)

Try it online!

Maplesoft Maple, 23 bytes
f:=a->fsolve(x^5+x+a=0)

Unfortunately, there is no online Maple compiler/calculator out there AFAIK. But the code is pretty straightforward.

C,118b/96b
#include<math.h>
double ur(double a){double x=a,t=1;while(fabs(t)>1e-6){t=x*x*x*x;t=(x*t+x+a)/(5*t+1);x-=t;}return x;}

118 bytes with original function name and with some extra accuracy (double).
With bit hacks may be better, but unportable.
96 bytes with fixed iterations.
double ur(double a){double x=a,t;for(int k=0;k<99;k++){t=x*x*x*x;x=(4*x*t-a)/(5*t+1);}return x;}

Actually, our function is so good we can use better adaptations of Newton's method. Much faster and practical implementation (150 bytes) would be
#include<math.h>
double ur(double a){double x=a/5,f=1,t;while(fabs(f)>1e-6){t=x*x*x*x;f=(t*(5*t*x+5*a+6*x)+a+x)/(15*t*t-10*a*x*x*x+1);x-=f;}return x;}

I checked it works, but I'm too lazy to find out how much more fast it would be. Should be at least one more order faster as Newton's.

Would something like x-=t=... work?

82 bytes

Pari/GP, 24 bytes
a->polrootsreal(x^5+x+a)

Try it online!

Nice, didn't know that solve has an analogue

MMIX, 68 bytes (17 instrs)
(jelly-style xxd -g4)
00000000: e0043ff0 e0034014 79010001 3b01013f  ṭ¥?ṅṭ¤@Þy¢¡¢;¢¢?
00000010: e8013ff0 c1020100 10ff0202 10ffffff  ċ¢?ṅḊ£¢¡Ñ”££Ñ”””
00000020: 1001ff02 10ffff03 e4010020 04ffff04  Ñ¢”£Ñ””¤ỵ¢¡ ¥””¥
00000030: 06010100 140101ff 11020102 5b02fff6  ©¢¢¡Þ¢¢”×£¢£[£”ẇ
00000040: f8020000                             ẏ£¡¡

Disassembly
bringr  SETH  $4,#3FF0          // one = 1.
        SETH  $3,#4014          // five = 5.
        ZSNN  $1,$0,1           // x = (a neg? 0 : 1)
        SLU   $1,$1,63          // x <<= 63
        ORH   $1,#3FF0          // x |= 1. [now x = a neg? 1. : -1.]
0H      SET   $2,$1             // loop: px = x
        FMUL  $255,$2,$2        // t = px *. px
        FMUL  $255,$255,$255    // t = t *. t
        FMUL  $1,$255,$2        // x = t *. px
        FMUL  $255,$255,$3      // px = px *. five
        INCH  $1,#20            // x *.= 4. (bit trick: add two to exponent)
        FADD  $255,$255,$4      // t = t +. one
        FSUB  $1,$1,$0          // x = x -. a
        FDIV  $1,$1,$255        // x = x /. t
        FCMPE $2,$1,$2          // px = epsilon_comp(x, px)
        PBNZ  $2,0B             // iflikely(px) goto loop
        POP   2,0               // return x

I used WolframAlpha to simplify Newton's method for this. It said that \$\def\d{{\rm d}}x-{x^5+x+a\over{\d\over \d x}x^5+x+a}\$ simplified down to \$4x^5-a\over5x^4+1\$. The convergence test here is a builtin epsilon-convergence, so rE must be set by the calling function.
For faster convergence, change ORH $1,#3FF0 to
        SLU  $255,$0,1      // 3BFF0001 ;”¡¢ shift left to erase sign
        INCH $255,#8020     // E4FF8020 ỵ”⁰  unbias exponent
        PUT  rD,0           // F7010000 ẋ¢¡¡ prep dividend
        DIVU $2,$255,5      // 1F02FF05 þ£”¦ take approximate fifth root
        CSN  $2,$255,$255   // 6002FFFF `£”” and use that if we are >1
        INCH $2,#7FE0       // E4027FE0 ỵ£¶ṭ rebias exponent
        SRU  $255,$2,1      // 3FFF0201 ?”£¢ shift right again
        OR   $1,$1,$255     // C00101FF Ċ¢¢” or sign and guess

Excel (Insider Beta), 59 bytes
=h(a1,1)
h =LAMBDA(a,x,IF(a=x^5+x,x,h(a,(a/(x^5+x))^0.2*x))) in name manager

1 byte for name h in name manager, 49 bytes for formula for h, 9 bytes for calling h. Uses successive approximations using the 5th root of a/(x^0.5+x) times x.  Initial call uses 1 for x.

Clean, 61 60 bytes
import StdEnv
$a=iter 99(\x=(3.0*x^5.0-a)/inc(4.0*x^4.0))0.0

Try it online!
Newton's method, first implemented in user202729's answer.
Clean, 124 bytes
import StdEnv
$a= ?a(~a)with@x=abs(x^5.0+x+a);?u v|u-d==u=u|v+d==v=v= ?(u+if(@u< @v)0.0d)(v-if(@u> @v)0.0d)where d=(v-u)/3E1

Try it online!
A "binary" search, narrowing the search area to the upper or lower 99.6% of the range between the high and low bounds at each iteration instead of 50%.

Python 3 + sympy, 72 bytes
lambda y:float(sympy.poly("x**5+x+"+str(y)).all_roots()[0])
import sympy

Try it online!

TI-Basic (TI-83), 12 bytes
solve(X^5+X+Ans,X,0

TI-Basic (TI-89), 13* bytes
solve(x^5+x=-a,x)→f(a)

*Not completely sure how to score ti-89 programs/functions

Scala, 74 bytes
Using Newton-Raphson with a fixed number of iterations, and the same approximation trick as @Arnauld
Golfed version. Try it online!
def f(a:Double)={var x=a/5;(1 to 99).foreach{_=>x-=(a/(x*x*x*x+1)+x)/5};x}

Ungolfed version. Try it online!
import scala.math._

object Main {
  def main(args: Array[String]): Unit = {
    val f: Double => Double = a => {
      var x = a / 5
      (1 to 99).foreach { _ =>
        x -= (a / (x * x * x * x + 1) + x) / 5
      }
      x
    }

    val inputs = List(-100010.0, 0.0, 1.0, -1.0, exp(1), pow(2, 0.5), 1073741888.0)
    inputs.foreach { x =>
      println(s"%.9f --> %.9f".format(x, f(x)))
    }
  }
}

authors: ə̷̶̸͇̘̜́̍͗̂̄︣͟


text:
French license plates
Sandbox
French License Plates
French license plates come in a sequential order, following a specific pattern of numbers and letters : AB-012-CD
Challenge
Write a program or function that, for a given number, outputs the corresponding french license plate number. Your program should not handle any special case as specified in the linked page. It should be able to generate the full 26*26*1000*26*26 => 456 976 000 possible plates, or as far as your language can support.
The numbering system goes as follows:

AA-000-AA to AA-999-AA (numbers evolve first);
AA-000-AB to AA-999-AZ (then the last letter on the right);
AA-000-BA to AA-999-ZZ (then the first letter on the right);
AB-000-AA to AZ-999-ZZ (then the last letter on the left);
BA-000-AA to ZZ-999-ZZ (then the first letter on the left).

Input

The plate number's index as an integer

Output

The corresponding french license plate number

Additional information

Letters have to be uppercase
You can use both 0-based and 1-based indexing to generate the plates (meaning AA-000-AA can correspond to 0or 1, assuming all the other test cases use the same indexing.

This is code-golf, shortest answer in every language wins!
Test cases (0-based indexing)
          0 -> AA-000-AA
          1 -> AA-001-AA
        999 -> AA-999-AA
       1000 -> AA-000-AB
    675 999 -> AA-999-ZZ
    676 000 -> AB-000-AA
456 975 999 -> ZZ-999-ZZ

Here are some more requirements, directly from Wikipedia, if you want to create a harder variation : "This figure excludes three letters that are not used: I, O and U, as they can be confused with 1, 0 and V, respectively. It also excludes the SS combination because it is reminiscent of the Nazi organisation and WW in the first group of letters as it indicates a temporary plate."

@EricDuminil I purposefully excluded it because it just added unfun constraints on the challenge. But it's true it could be interesting to do, but even with "bonus points", I doubt it would be worth implementing these rules

Perl 5 (-ap), 47 bytes
$_=AAAA000;$_++while$F[0]--;s/(..)(\d+)/-$2-$1/

Try it online!

PHP, 74 bytes
for($a=AAAA000;$argn--;$a++);echo preg_replace('/(..)(\d+)/','-$2-$1',$a);

Try it online!

+1 for PHP, I knew we could increment letters in PHP, but I didn't know that we can increment a combination of letters and digits. PHP amazes me every day! And thanks I learned something new.

Pure Bash (no external utils), 64

2 bytes saved thanks to @NahuelFouilleul

x={A..Z}
eval f=($x$x-%03d-$x$x)
printf ${f[$1/1000]} $[$1%1000]

Try it online! - takes about 10s to run over the 7 testcases.

Line #1 is a simple assignment of a string to a variable
Line #2 is a brace expansion to build an array of printf format strings, one for all 456,976 possible letter combinations, with the digits not yet specified.  The eval is required to ensure variable expansion (of x) occurs before brace expansion.
Line #3 indexes the array to get the appropriate format string and takes the digits portion as its parameter.

-2bytes

Ruby, 61 59 55 bytes
->n{s='AA-AA000-';eval's.succ!;'*n;s[2]+=s[5,4];s[0,9]}

Also 55 bytes:
->n{s='AA-AA000-';eval's.succ!;'*n;s[2]+=s.slice!5,4;s}

Try it online!
This initializes a counter to AA-AA000-, increments it n times (by multiplying a string of the code that does so by n and evaling), and then moves the last 4 characters after the 3nd.

->n{s=('AA-AA000-'..?Z*9).step.take(n)[-1];s[2]+=s.slice!5,4;s} is longer but I wonder if it's possible to shorten it.

In theory, ->n{s=[*'AA-AA000-'..?Z*9][n];s[2]+=s.slice!5,4;s} should work and is only 50 bytes long, but it generates every possible plate first. :-/

"s+=s.slice!3,2" for 50 bytes

Then this should also work: 45 bytes

Python 3, 79 78 77 bytes
lambda n:f"%c%c-{n%1000:03}-%c%c"%(*(65+n//1000//26**i%26for i in[3,2,1,0]),)

Try it online!
I somehow never realised that the f"string" format shortcut exists until seeing Black Owl Kai's answer.

78 bytes by replacing tuple by (*...,)

Using f"string" makes your answer Python 3.6+ exclusive, just so you are aware. Nice work though!

C, 88 86 bytes

#define d(b)a/b/1000%26+65
f(a){printf("%c%c-%03d-%c%c",d(17576),d(676),a%1000,d(26),d(1));}

Pretty simple, it uses division and modulus to extract the fields, adds 'A' for the letters to map them to ASCII characters, and printf formatting for the numbers.
Try it online!

PHP, 96 84 79 bytes
-5 byte thanks to Ismael Miguel's great comments.
for($s=AAAA;$x++^$argn/1e3;)$s++;printf('%.2s-%03u-'.$s[2].$s[3],$s,$argn%1e3);

Try it online!
I take advantage of the fact that you can increment letters in PHP! So AAAA++ would become AAAB and AAAZ++ would become AABA. I calculate how many times the letters have to be incremented by getting integer part of input/1000. Then increment the four characters length that many times and its first two and last two characters will automatically become the left and right side of the plate.
For example for input of 675999 number of letter increments is (int)(675999 / 1000) = 675, so AAAA will become AAZZ.
Finally, the middle number is calculated by input%1000 and everything is printed in the specified format with help of printf. %.2s prints first two characters of the string, %03u pads the number in the left with 3 zeros.

Looks like it breaks for 456975999, it returns YYAA999ZZ, also you need the dashes inbetween the parts :P

@Elcan Sorry, fixed the issues at a cost of 12 bytes. I have an excuse of being under attack by three cats, for my messing up :P

All good, now you have a working answer :P

Instead of %0.2s you can write %.2s. That saves you 1 byte. (As a tiny tip: if you want to output a decimal number with a specific number of decimal places, you can do %.2f (or any other modifier) as it works the same way)

@IsmaelMiguel Thanks, didn't know we could drop the 0. Edit: looking at documentations, it seems I didn't even need it at the first place :P

Oh, yeah, you can drop those. Also, you can do $x++^$argn/1e3 instead of $x++<(0^$argn/1e3) and you should save 4 bytes. This will loop until ($x++^$argn/1e3) === 0, and it is 0 when $x and $argn/1e3 are the same integer number (using ^ will cast the numbers to integer). You can try this on http://sandbox.onlinephpfunctions.com/code/ab053fc9beff6ba616734e194efb1a0373de91e4

@IsmaelMiguel Thanks again, very clever idea. You made this answer shorter than JS one and that is an achievement :P

You're welcome. I've been thinking about ways to reduce this answer (using a negative number to save a dash, splitting AAAA at the end, etc.) and nothing so far :/

@IsmaelMiguel, Grimy already has a shorter version here: https://codegolf.stackexchange.com/a/193442/81663

Haskell, 85 81 79 77 bytes
([h++'-':n++'-':t|h<-q"AZ",t<-q"AZ",n<-q"099"]!!)
q g=mapM(\_->[g!!0..g!!1])g

Try it online!

05AB1E, 25 22 20 bytes
Au2ããs₄‰`UèX₄+¦'-.øý

-2 bytes (and increased the performance by not generating the entire list) thanks to @Grimy.
0-based indexing.
Try it online or verify all test cases.
Explanation:
Au            # Push the lowercase alphabet, and uppercase it
  2ã          # Create all possible pairs by taking the cartesian product with itself:
              #  ["AA","AB","AC",...,"ZY","ZZ"]
    ã         # Get the cartesian product of this list with itself:
              #  [["AA","AA"],["AA","AB"],...,["ZZ","ZZ"]]
s             # Swap to push the (implicit) input
 ₄‰           # Take the divmod-1000 of it
              #  i.e. 7483045 becomes [7483,45]
    `         # Push these values separated to the stack
     U        # Pop and store the remainder part in variable `X`
      è       # Index the integer part into the list of letter-pairs we created earlier
              #  i.e. 7483 will result in ["AL","BV"]
X             # Push the remainder part from variable `X` again
 ₄+           # Add 1000 to it
   ¦          # And remove the leading 1 (so now the number is padded with leading 0s)
              #  i.e. 45 becomes 1045 and then "045"
    '-.ø     '# Surround this with "-" (i.e. "045" becomes "-045-")
        ý     # Join the two pairs of letters by this
              #  i.e. ["AL","BV"] and "-045-" becomes "AL-045-BV"
              # (after which the top of the stack is output implicitly as result)

The last part (s₄‰`UèX₄+¦'-.øý) could be I₄÷èI₄+3.£.ý'-ý for an equal-bytes alternative:
Try it online or verify all test cases.
I₄÷           # Push the input, integer-divided by 1000
   è          # Use it to index into the letter-pairs we created earlier
              #  i.e. 7483045 becomes 7483 and then ["AL","BV"]
I₄+           # Push the input again, and add 1000
   3.£        # Only leave the last three digits
              #  i.e. 7483045 becomes 7484045 and then "045"
      .ý      # Intersperse the pair with this
              #  i.e. ["AL","BV"] and "045" becomes ["AL","045","BV"]
        '-ý  '# And join this list by "-"
              #  i.e. ["AL","045","BV"] becomes "AL-045-BV"
              # (after which the top of the stack is output implicitly as result)

20 with Au2ããI₄‰`UèX₄+¦'-.øý or Au2ããI₄÷èI₄+3.£'-.øý.

@Grimy Thanks! And now it's also a lot faster by not generating and indexing into the complete list. :)

J, 56 49 46 bytes
226950 A.'--',7$_3|.4,@u:65 48+/(4 3#26 10)#:]

Try it online!
-3 bytes thanks to FrownyFrog
The whole thing is nothing but 7 nested trains -- if that ain't fun, what is?
  ┌─ 226950
  ├─ A.
  │        ┌─ '--'
──┤        ├─ ,
  │        │      ┌─ 7
  └────────┤      ├─ $
           │      │   ┌─ _3
           └──────┤   ├─ |.
                  │   │    ┌─ 4
                  └───┤    │     ┌─ ,
                      │    ├─ @ ─┴─ u:
                      └────┤
                           │     ┌─ 65 48
                           │     ├─ / ───── +
                           └─────┤
                                 │       ┌─ '4 3#26 10'
                                 └───────┼─ #:
                                         └─ ]

Cool! Using permutation is a nice way to format the resulting string.

46

Thanks @FrownyFrog!

Ruby, 51 bytes
->n{[*?A*4..?Z*4][n/1e3][/../]+"-%03d-"%(n%1e3)+$'}

Try it online!

Impressive. Congrats!

JavaScript (Node.js), 82 bytes
n=>'32-654-10'.replace(/\d/g,x=>Buffer([x&4?n/10**(x-4)%10+48:n/1e3/26**x%26+65]))

Try it online!

R, 101 bytes
b=0:3;a=scan()%/%c(10^b,1e3*26^b)%%rep(c(10,26),e=4);intToUtf8(c(a[8:7],-20,a[3:1]-17,-20,a[6:5])+65)

Try it online!
Just does the needed arithmetic computations. I saved 5 bytes by including in the vector a a useless value at a[4], allowing me to reuse the helper vector b.
Consider for example the second character (the B in AB-012-CD). That character changes every \$26\times26\times1000=676\,000\$ plates, so the value of that character for input n is the n %/% 676000 %% 26th letter of the alphabet, where %/% is integer division and %% is modulus in R. The other characters are computed similarly.

Jelly,  26  22 bytes
ØAṗ2,`ØDṗ3¤ṭŒp⁸ị2œ?j”-

A monadic Link accepting an integer (1-indexed) which yields a list of characters... Crazy-slow since it builds all the plates first!
Try it online! (wont complete)
Or try a reduced alphabet version (only "ABC" for the letters).

For code which completes in a timely manner here's a 32 byte full-program (0-indexed) which creates the single plate instead using modular arithmetic and numeric base decompression:
dȷ+“©L§“£ż’µḢṃØAṙ1¤ḊŒHW€jDḊ€$j”-

Try this one!

Misses the dashes it seems, so for now it doesn't fit the challenge's rules :P

Ah, I completely ignored them as some kind of separator! Makes quite a difference for these methods :(

Sorry about that :c Still pretty nice to see it done in Jelly, even without !

Added 7 byes to add them in, pretty sure there is a shorter overall method now...

Oops, thanks @Grimy - may as well golf that by 3 while I'm here :p – Jonathan Allan 1 min ago

Perl 6, 42 bytes
{S/(..)(\d+)/-$1-$0/}o{('AAAA000'..*)[$_]}

Try it online!
Port of Grimy's Perl 5 solution. Slow for large input values.

Excel, 183 167 155 147 bytes
-16 bytes thanks to @Neil. (6 by using E3)
-12 bytes thanks to @Keeta. (TRUNC instead of QUOTIENT)
-8 bytes thanks to @Jonathan Larouche (INT instead of TRUNC)
=CHAR(65+INT(A1/17576E3))&CHAR(65+MOD(INT(A1/676E3),26))&"-"&TEXT(MOD(A1,1E3),"000")&"-"&CHAR(65+MOD(INT(A1/26E3),26))&CHAR(65+MOD(INT(A1/1E3),26))

Concatenates 5 parts:
CHAR(65+INT(A1/17576E3))
CHAR(65+MOD(INT(A1/676E3),26))
TEXT(MOD(A1,1E3),"000")
CHAR(65+MOD(INT(A1/26E3),26))
CHAR(65+MOD(INT(A1/1E3),26))

Does MOD(QUOTIENT(A1,1E3),26) not work? Also, why 1E3 for 1000 but not 26E3 etc?

Save even more by removing TRUNC altogether and moving the division to inside the MOD.   =CHAR(65+A1/17576E3)&CHAR(65+MOD(A1/676E3,26))&"-"&TEXT(MOD(A1,1E3),"000")&"-"&CHAR(65+MOD(A1/26E3,26))&CHAR(65+MOD(A1/1E3,26))  bringing it down to 127 bytes.

I meant removing QUOTIENT.  Originally I was suggesting to change quotient to trunc with a / instead of comma.

@Keeta, your 127 byte solution fails for some values:
e.g. 456 975 996 --> [Z-996-ZZ

@Keeta, Seems like CHAR(65+) silently truncates decimals up to %.9999997614649.  Bigger than that is rounded up.
Compare CHAR(65+24.9999997614649) and CHAR(65+24.999999761465).

Stranger still, removing 65+ changes the behaviour.

Have you tested TRUNC(A1/17576E3) instead of QUOTIENT(A1,17576E3)?

Even shorter, INT(A1/17576E3) instead of TRUNC(). 2 bytes times 4 : -8 bytes

APL+WIN, 61 bytes
Prompts for integer:
m←⎕av[4↑66+n←((4⍴26),1E3)⊤⎕]⋄(2↑m),'-',(¯3↑'00',⍕4↓n),'-',2↓m

Try it online! Courtesy of Dyalog Classic

Charcoal, 33 bytes
Ｎθ¹✂Ｉ⁺θφ±³≔⪪⍘⁺Ｘ²⁶¦⁵÷θφα²η¹⊟ηＭ⁹←⊟η

Try it online! Link is to verbose version of code. Explanation:
Ｎθ

Input the number.
¹

Print a -.
✂Ｉ⁺θφ±³

Add 1000 to the number, then cast the result to string, and print the last three digits.
≔⪪⍘⁺Ｘ²⁶¦⁵÷θφα²η

Divide the number by 1000, then add 26⁵, so the conversion to custom base using the uppercase alphabet results in a string of length 6, which is then split into pairs of letters.
¹

Print a -.
⊟η

Print the last pair of letters.
Ｍ⁹←

Move to the beginning of the number plate.
⊟η

Print the rest of the desired letters.

T-SQL, 135 bytes
select concat(CHAR(65+(@i/17576000)),CHAR(65+(@i/676000)%26),'-',right(1e3+@i%1000,3),'-',CHAR(65+(@i/26000)%26),CHAR(65+(@i/1000)%26))

Japt, 21 bytes
Obscenely slow! Seriously, don't even try to run it!
Tip of the hat to Kevin for making me realise where I was going wrong when fighting to get this working last night.
;gBï ï ïq#d0o ùT3 û-5

Try it - limits the number range to 000-005.
;gBï ï ïq#d0o ùT3 û-5     :Implicit input of integer
 g                        :Index into
; B                       :  Uppercase alphabet
   ï                      :  Cartesian product with itself
     ï                    :  Cartesian product of the result with itself
       ï                  :  Cartesian product of that with
         #d0              :    1000
            o             :    Range [0,1000)
              ùT3         :    Left pad each with 0 to length 3
                  û-5     :    Centre pad each with "-" to length 5
        q                 :  Join the first element (the 2 pairs of letters) with the second (the padded digit string)

Forth (gforth), 94 bytes
: x /mod 65 + emit ; : f dup 1000 / 17576 x 676 x ." -"swap 0 <# # # # #> type ." -"26 x 1 x ;

Try it online!
0-indexed. Input is taken from top of stack
Code explanation
\ extract out some common logic
: x             \ start a new word definition
  /mod          \ divide first argument by second and get both quotient and remainder
  65 +          \ add 65 (ascii A) to quotient
  emit          \ output
;               \ end word definition

: f             \ start a new word definition
  dup 100 /     \ duplicate input and divide by 1000
  17576 x       \ divide by 26^3 and output ascii char
  676 x         \ divide by 26^2 and output ascii char
  ." -"         \ output "-"
  swap 0        \ grab original number and convert to double-cell number
  <# # # # #>   \ convert last 3 chars of number to a string
  type ." -"    \ output string followed by "-"
  26 x          \ divide result of last mod by 26 and output ascii char
  1 x           \ output ascii char for remaining amount
;               \ end word definition

q, 78 bytes
{sv["-","0"^-4$($:[x mod 1000]),"-"]2 2#(|).Q.A mod[x div 1000*26 xexp(!)4]26}

                                                    x div 1000*26 xexp(!)4     / input (floor) divided by 1000*26 ^ 0 1 2 3
                                                mod[                      ]26  / mod 26
                                           .Q.a                                / alphabet uppercase, indexed into by preceeding lines, for x=1000, we'd get "BAAA"
                                    2 2#(|)                                    / reverse and cut into 2x2 matrix ("AA";"AB")
               ($:[x mod 1000]),"-"                                            / string cast x mod 1000 and append "-"
            -4$                                                                / left pad to length 4, "  0-"
    "-","0"^                                                                   / fill nulls (" ") with "0" and prepend "-"
 sv[              x                ]y                                          / join elems of y by x

Clean, 107 bytes
import StdEnv
A=['A'..'Z']
N=['0'..'9']
$n=[[a,b,'-',x,y,z,'-',c,d]\\a<-A,b<-A,c<-A,d<-A,x<-N,y<-N,z<-N]!!n

Try it online!
Defines $ :: Int -> [Char] giving the n-th zero-indexed licence plate.

Julia 1.0, 86 bytes
i->(join('A'.+digits(i÷1000,base=26,pad=4))string(i%1000,pad=3)*'-')[[4;3;8;5:8;2;1]]

Try it online!

C (gcc), 136 106 105 bytes
#define P(i)s[i]=65+x%26;x/=26;
z;s[]=L"  -%03d-  ";f(x){z=x%1000;x/=1e3;P(9)P(8)P(1)P(0)wprintf(s,z);}

Try it online!
-7 bytes from celingcat's solution, with additional -23 inspired by it
-1 byte from ceilingcat's solution by changing the char[] to a wchar_t[] implicitly cast to int[]
Uses 0-based indexing.
Explanation/Ungolfed:
int s[] = L"  -%03d-  "; // Pre-made wide-string with dashes and ending null byte
                         // and wprintf directive for digits
int z;                   // Temporary variable to store the digit part
void f(int x) {
    z = x % 1000;        // The digits represent x % 1000
    x /= 1000;
    s[9] = 'A' + x % 26; // Place least significant letter
    x /= 26;             // Divide off least significant letter
    s[8] = 'A' + x % 26; // Place second letter
    x /= 26;             // Divide off second letter
    s[1] = 'A' + x % 26; // Place third letter
    x /= 26;             // Divide off third letter
    s[0] = 'A' + x;      // Place fourth letter (Don't need to % 26 because x < 26 now)
    wprintf(s, z); // Print finished string (with x%1000 replacing %03d)
}

@ceilingcat Thanks! Using that idea I removed the a and b parameters from the macro and got down to 106 bytes

Red, 130 127 bytes
func[n][g: func[a b c][t: copy""loop a[insert t b +(n % c)n: n / c]t]a: g 3 #"0"10
s: g 4 #"A"26 rejoin[s/1 s/2"-"a"-"s/3 s/4]]

Try it online!

MATLAB, 113 bytes
c=@(x,p)char(mod(idivide(x,1000*26^p),26)+65);
s=@(n)[c(n,3),c(n,2),num2str(mod(n,1000),'-%03d-'),c(n,1),c(n,0)]

Explanations:
The first line define a function which will produce a char (from A to Z), function of 2 inputs. The index number x to convert into a plate number, and an integer p which will be used as an exponent for 26 (i.e. 26^p). This second input allow to adjust the calculations for the first alphanumeric plate digit (p=3) down to the last one (p=0).
For example, for the second digit, cycled every 1000*26*26 iterations, the operation: mod(idivide(x,1000*26^2),26) return an index between 0 and 25, which is then converted to an ASCII char by adding 65 (because the index are 0 based)
The second line simply concatenate characters together. Each alphanumeric character is calculated with the use of the function c(x,p), the numeric character are simply calculated with a modulo operation and converted to string.
Each component of the string composing the plate number is as follow:
digit #     |    how often is it cycled             |  code
----------------------------------------------------------------
digit 1     | cycle every 1000*26*26*26=1000*26^3   | c(n,3)
digit 2     | cycle every 1000*26*26   =1000*26^2   | c(n,2)
digit 3,4,5 | cycle every iteration                 | num2str(mod(n,1000),'-%03d-')
digit 6     | cycle every 1000*26      =1000*26^1   | c(n,1)
digit 7     | cycle every 1000         =1000*26^0   | c(n,0)

Since I can't let you try MATLAB online (edit: actually you can try it online ), I'll let MATLAB users the possibility to verify the test cases:
% chose some test cases
n = uint32([0;1;999;1000;675999;676000;456975999]) ;

% work out their plate numbers
plates = s(n) ;

% display results
fprintf('\n%10s | Plate # \n','Index')
for k=1:numel(n)
    fprintf('%10d : %s\n',n(k),plates(k,:))
end

outputs:
     Index | Plate #
         0 : AA-000-AA
         1 : AA-001-AA
       999 : AA-999-AA
      1000 : AA-000-AB
    675999 : AA-999-ZZ
    676000 : AB-000-AA
 456975999 : ZZ-999-ZZ

Variant:
Note that the option to let sprintf or fprintf take care of the number to character conversion is possible. It allow to simplify the function c, but overall result in a few more bytes in this implementation (119 bytes):
c=@(x,p)mod(idivide(x,1000*26^p),26)+65 ;
s=@(n)sprintf('%c%c-%03d-%c%c\n',[c(n,3),c(n,2),mod(n,1000),c(n,1),c(n,0)]')

Python 3, 89 bytes
lambda n:h(n//676)+f"-{n%1000:03}-"+h(n)
h=lambda x:'%c%c'%(x//26000%26+65,x//1000%26+65)

Try it online!
-1 byte thanks to mypetlion

Change chr(x//26000%26+65)+chr(x//1000%26+65) to '%c%c'%(x//26000%26+65,x//1000%26+65) to save 1 byte.

Python 2, 88 bytes
lambda n:g(n/676000)+'-%03d-'%(n%1000)+g(n/1000)
g=lambda n:chr(65+n/26%26)+chr(65+n%26)

Try it online!

The save by mypetition under my answer can be applied for Python 2, too

Kotlin, 93 bytes
{i:Int->val c={v:Int->'A'+i/v/1000%26}
""+c(17576)+c(676)+"-%03d-".format(i%1000)+c(26)+c(1)}

Try it online!

Python 3, 161 bytes
i,t,u,v,a,c,f=int(input()),1000,676,26,ord('A'),chr,lambda x:c(a+x//v)+c(a+x%v)
m,n=i%t,i//t
e,o=n%u,n//u
print('-'.join([f(o),(3-len(str(m)))*'0'+str(m),f(e)]))

Try it online!

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
A really inefficient calculator
Challenge: Add two numbers. In O(n^m) time, where n and m are the two numbers given. Sleeping, or your language equivalent, is not allowed.
Input: Two integers, separated by a space.
Output: The sum of the two integers.
Additional notes: The exact timing doesn't matter, as long as the input 1000 2 takes roughly 1/1000th the time as the input 1000 3

O(n^m) time means at most n^m asymptotically. I think you want theta.

I presume you want people to use some kind of super slow algorithm, but there's nothing stopping them from doing simple addition followed by an n^m loop of NOPs to pad the runtime. I don't think there's a way around that (we do not allow unobservable requirements) but just a warning that submissions may be less interesting than you envisioned.

Is it OK if a program takes n^m time to complete after printing the sum, or would it have to take the time before printing?

Why the awkward input requirement. Can I really not just take two arguments?

So 2 100 should be approximately 100 septillion times slower than 100 2?

Maybe try the sandbox next time to get feedback on your challenge before you post it. And why not try to answer some challenges yourself! Then you get a good feel for what works.

@Sanchises Given that all of the current answers are doing effectively that (no-op to pad run time) I'll guess that they're allowed...

APL (Dyalog Unicode), 4 bytesSBCS
Anonymous tacit infix function:
⊃*⍴+

Try it online!
However, if it really needs to take the two arguments together, separated by a space, we need the following anonymous tacit prefix function:
APL (Dyalog Unicode), 6 bytesSBCS
⊃*/⍴+/

Try it online!
+ or +/ sum the numbers
⍴ cyclically reshape that to the following length:
* or */ one number raised to the power of the other
⊃ pick the first element of that

Python 3, 34 bytes
lambda n,m:sum(range(n**m))and m+n

Try it online!
Alternatively, as suggested by user202729:
Python 2, 26 bytes
lambda n,m:n**m*[1]and n+m

Try it online!
which also works with Python 3.

Why sum(…)? Isn't range(n**m) already $O(n^m)$?

@Adám Yes in Python 2, but not in Python 3 where range doesn't actually create the list: TIO

What about [1]*?

@user202729 : I'd guess you're right.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Split string using rules
Introduction
Some time ago, I need to write function which split string in some specific way. At the first look, task looks trivial, but it was not so easy - especially when I want to decrease code size.
Challenge
As example we have following input string (it can be arbitrary)

Lorem ipsum dolor sit amet consectetur adipiscing elit sed doeiusmod tempor incididunt ut Duis aute irure dolor in reprehenderit in esse cillum dolor eu fugia ...

We need to splitting it into elements (
groups of adjacent words) using following  rules (A-E)
 "Lorem ipsum dolor",  // A: take Three words if each has <6 letters
 "sit amet",           // B: take Two words if they have <6 letters and third word >=6 letters
 "consectetur",        // C: take One word >=6 letters if next word >=6 letters
 "adipiscing elit",    // D: take Two words when first >=6, second <6 letters
 "sed doeiusmod",      // E: Two words when first<6, second >=6 letters
 "tempor"              // rule C
 "incididunt ut"       // rule D
 "Duis aute irure"     // rule A
 "dolor in"            // rule B
 "reprehenderit in"    // rule D
 "esse cillum"         // rule E
 "dolor eu fugia"      // rule D
 ...

So as you can see input string (only alphanumeric characters) is divided to elements (substrings) - each element can have min one and max three words. You have 5 rules (A-E) to divide your string - if you take words one by one from beginning - only one of this rule applied. When you find rule, then you will know how many words move from input to output (1,2 or 3 words) - after that start again: find next rule for the remaining input words.
Boundary conditions: if last words/word not match any rules then just add them as last element (but two long words cannot be newer in one element)
In the output we should get divided string - each element separated by new line or | (you don't need to use double quotes to wrap each element)
Example Input and Output
Here is example input (only alphanumeric ASCII characters):
Lorem ipsum dolor sit amet consectetur adipiscing elit sed doeiusmod tempor incididunt ut Duis aute irure dolor in reprehenderit in esse cillum dolor eu fugia

and its output:
Lorem ipsum dolor|sit amet|consectetur|adipiscing elit|sed doeiusmod|tempor|incididunt ut|Duis aute irure|dolor in|reprehenderit in|esse cillum|dolor eu fugia

I'm not understanding what's going on with the example. Could you explain how the splitting rules work in general?

It is hard to describe in general - but I will try - you have 6 rules (A-B) to divide your string - if you take words one by one - only one of this rule applied

@xnor while (word length < 6) {join next word (max 3 words per groups)} else if (word length >= 6) { if (next one length is < 6)  {return the pair} else { return group as is }

@KamilKiełczewski "you have 6 rules (A-B)". Don't you mean 5 rules (A-E)?..

Can we take the input as a list of words?

@KevinCruijssen if your language not support strings as input - then yes - you can use list. Rules: it was mistake in my previous comment - it should be 5 (A-E) + boundary condition

I'm still pretty confused, but maybe it's just me given the answers and reopen votes.

Can the input include any characters other than ASCII letters and the space character? If so, what should be done with them?

@aschepler only ascii allowed

Jelly, 23 bytes
ḲµẈṁ3<6Ḅ+8:5⁸sḢKṄȧƲẎµ¹¿

A full-program printing the result.
Try it online!
How?
Given the lengths of three words (a, b, and c) we can write the following mapping for how many word we should take:
a<6?  b<6?  c<6?   words
   1     1     1     3
   1     1     0     2
   1     0     1     2
   1     0     0     2
   0     1     1     2
   0     1     0     2
   0     0     1     1
   0     0     0     1

Treating the comparisons as a single number in binary this is:
bin([a<6,b<6,c<6]):   7   6   5   4   3   2   1   0
             words:   3   2   2   2   2   2   1   1

So we can map like so:
bin([a<6,b<6,c<6]):   7   6   5   4   3   2   1   0
         add eight:  15  14  13  12  11  10   9   8
    divide by five:   3   2   2   2   2   2   1   1

Note that when less than three words remain we want to take all of them, unless there are two left and they are both of length six or more when case C says to take one word. To make this the case we repeat what we have up to length three (with ṁ3 instead of ḣ3) and use that.
a<6?  b<6?         moulded  bin  + 8  div 5 (= words)
   1                111     7    15   3  (i.e. all 1)
   0                000     0     8   2  (i.e. all 1)
   1    1           111     7    15   3  (i.e. all 2)
   1    0           101     5    13   2  (i.e. all 2)
   0    1           010     2    10   2  (i.e. all 2)
   0    0 (i.e. C)  000     0     8   1  (i.e. just 1)

The code then works as follows.
ḲµẈṁ3<6Ḅ+8:5⁸sḢKṄȧƲẎµ¹¿ - Main Link: list of characters
Ḳ                       - split at spaces
                      ¿ - while...
                     ¹  - ...condition: identity (i.e. while there are still words)
 µ                  µ   - ...do: the monadic chain:
  Ẉ                     -   length of each
    3                   -   literal three
   ṁ                    -   mould like ([1,2,3])
      6                 -   literal six
     <                  -   less than? (vectorises)
       Ḅ                -   from binary to integer
         8              -   literal eight
        +               -   add
           5            -   literal five
          :             -   integer divide
            ⁸           -   chain's left argument
             s          -   split into chunks (of that length)
                  Ʋ     -   last four links as a monad (f(x)):
              Ḣ         -     head (alters x too)
               K        -     join with spaces
                Ṅ       -     print & yield
                 ȧ      -     logical AND (with altered x)
                   Ẏ    -   tighten (back to a list of words)

wow - currently you also put on the leader's yellow jersey  - btw: nice explanation :)

Theoretically I am the only one wearing it (since I piped Nick to the post of reaching 23) but I'll very happily share it!

I don't know that - however you both has different but same size answers - so we have draw here

Yeah, same byte count, different programs, but a very similar method (now). The timing information is in the revision histories if you're interested, but do note that when looking at revisions of posts that updates within five minutes of another are bundled into one revision stamped at the original time (this feature can cause one to not really be able to tell). For what it's worth I imagine we came up with the similar methods independently too.

Python 2, 92 90 88 87 86 85 bytes
r=''
n=0
for w in input().split():L=w[:5]<w;x=n+L<3;r+='| '[x]+w;n=n*x-~L
print r[1:]

Try it online!
-1 byte, thanks to Kevin Cruijssen

Perl 5, 47 bytes
seems regex can be shorten with this equivalent one

s/(\w{1,5} ){3}|\w{6,} (?=\w{6})|\w+ \w+ /$&
/g

Try it online!
Previous regex
Perl 5, 86 bytes
s/(\w{1,5} ){3}|((\w{1,5} ){2}|\w{6,} )(?=\w{6})|\w{6,} \w{1,5} |\w{1,5} \w{6,} /$&
/g

Try it online!
Not valid:
Perl 5 (-M5.01 -lnF/(?:\S{1,5}\K\s+){3}|\S{6,}\K\s+(?=\S{6})|\S+\s+\S+\K\s+/), 9 bytes
say for@F

Try it online!

Nice answer. I was about to try and make a Retina answer for this challenge. A trivial port would be 82 bytes.

however not perfect because the trailing space is not removed

removing the trailing space 51 bytes

don't know how to count this 13 bytes version abusing command line options

It would be 13 bytes for the language Perl 5 with -lp and -F/(?:\S{1,5}\K\s+){3}|\S{6,}\K\s+(?=\S{6})|\S+\s+\S+\K\s+/ flags. Relevant meta post.

... which is a made-up language designed specifically for the challenge, meaning that version would be invalid.

@pppery Good point, didn't thought about that. I have used large flags before, like this .NET C# answer with two flags, but those are used a static imports. In this case it would indeed be a 'made-up' language (or should I say flag) only designed for this challenge.

i think made-up language applies for a language designed on purpose, it isn't exactly the case here however it's true that when most of the code can be done by the flags it should count somewhere

This 47 bytes answer is very nice - I like it - however it has some problems with boundary condition - if we remove three dots from end of input string, then we get wrong results - here - can you fix it?

indeed the reason is that in alternation the pattern are tried sequentially and the trailing space was not found when the ... where removed, the pattern should be safier but longer

⭐ - you get star for nice answer

AWK, 65 bytes (thanks manatwork!)
BEGIN{RS=FS}{printf(x=n+(L=length($1)>5)<3)?FS$1:"|"$1;n=n*x+L+1}

Try it online!
I didn't even know AWK had a ternary operator
AWK, 97 79 72 bytes (thanks manatwork!)
BEGIN{a[0]="|";a[1]=RS=FS}{printf a[x=n+(L=length($1)>5)<3]$1;n=n*x+L+1}

Try it online!
I shamelessly stole the algorithm from @TFeld's Python2 solution.

Compacted it a bit, but only tested with that single input. See if you can get something useful from it: Try it online!.

Oh, 2 more things: FS's default value is a single space, so you can use it to initialize RS; the challenge says the input will be “only alphanumeric characters”, so you can use printf instead of print, making the assignment to ORS unnecessary.

Ok, finally spent some time to give a closer look at that array a. A ternary operator would be shorter: Try it online!.

@manatwork I almost feel like you should submit that...I didn't even know AWK had a ternary operator :)

05AB1E, 28 bytes
0U#v„
 yg6@DX+3‹DŠX*+>Uèy}J¦

Port of @TFeld's Python answer, so make sure to upvote him!
Try it online.
Explanation:
0U                       # Set variable `X` to 0 (it's 1 by default)
#                        # Split the (implicit) input-string on spaces
 v                       # Loop over each word `y`:
      yg                 #  Get the length of the word
        6@               #  And check that it's >= 6
          D              #  Duplicate this
           X+            #  Add variable `X` to it
             3‹          #  And check that it's smaller than 3
               DŠ        #  Duplicate this as well, and triple-swap (a,b,c to c,a,b)
                 X*      #  Multiply the <3 check with variable `X`
                   +     #  Add it to the length >=6 check
                    >U   #  Increase it by 1, and set it as the new variable `X`
  „\n                 è  #  Index the <3 check into the string "\n "
                       y #  And push the current word
 }J                      # After the loop: join the entire stack together
   ¦                     # And remove the leading space
                         # (after which the top of the stack is output implicitly as result)

your answer is in the top

Clean, 206 bytes
import StdEnv,Text
$s=join"|"(map(join" "o map fst)(?[(w,size w<6)\\w<-split" "s]))
?l=case l of[a,b,c:t]|all(snd)[a,b,c]=[[a,b,c]: ?t];[a:t=:[b:_]]|not(snd a||snd b)=[[a]: ?t];[]=[];l=[take 2l: ?(drop 2l)]

Try it online!

Jelly, 27 23 bytes
ḲµẈ<6ḣ3Ḅ+8:5Ṭk⁸KṄṛɗ/µÐL

Try it online!
A full program that takes as its argument the input string and prints newline-separated groups of words. Takes advantage of the fact that if the current first three words have their length checked to see if <6 and this is then treated as a binary number, the number of words needed will be 1,1,2,2,2,2,2,2,3 for numbers from 0 to 7 respectively.
Explanation
Ḳ                       | Split at spaces
 µ                  µÐL | Repeat the following until no new results:
  Ẉ                     | - Lengths of lists (i.e. words)
   <6                   | - Less than 6
     ḣ3                 | - First three
       Ḅ                | - Comvert from binary to integer
        +8              | - Add 8
          :5            | - Integer divide by 5
            Ṭ           | - Convert from index to boolean list
             k⁸         | - Split input to this loop iteration at that point
                  ɗ/    | - Reduce using following as a dyad:
               K        |   - Join with spaces
                Ṅ       |   - Output with trailing newline
                 ṛ      |   - Right argument (i.e. rest of list)

do you take idea from Jonathan Allan answer in this version of your answer?

@KamilKiełczewski only really the idea of outputting the interim results during the loop rather than returning them from the link as a list.

your answer is in the top

Jelly, 24 bytes
Ḳµḣ3Ẉ5<+2/Ṁ3_⁸sḢKṄṛƲẎµ¹¿

Try it online!
-1 thanks to Jonathan Allan.

can you explain your solution?

@KamilKiełczewski Eh, I'm a bit tired right now. Might explain tomorrow.

your answer is in the top

Charcoal, 49 bytes
≔⮌⪪Ｓ θＷθ«≔⌊⟦Ｌθ⊕ΣＥ²›⁶Ｌ§θ⁻κ²⟧ι⪫Ｅ⁻ι∧⁼ι³‹⁵Ｌ§θ±³⊟θ ¿θ|

Try it online! Link is to verbose version of code. Explanation:
≔⮌⪪Ｓ θ

Split the input into words and reverse it so that we can use Pop to remove words in order.
Ｗθ«

Repeat while there are still words left.
≔⌊⟦Ｌθ⊕ΣＥ²›⁶Ｌ§θ⁻κ²⟧ι

Estimate the number of words needed as equal to one more than the number of the first two words that are less than 6 letters, but no more than the number of words left.
⪫Ｅ⁻ι∧⁼ι³‹⁵Ｌ§θ±³⊟θ

Adjust the number of words if there are three and the third word is not less than 6 letters, then remove that many words and print them separated with spaces.
¿θ|

Output a separator if there are still more words left.

J, 55 53 bytes
</.~[:+/\@}:[:(}:@],[((3<]),,{~4>])_1{+)/0|.@,1+5<#&>

Try it online!

A accept this answer - however can I know why the output is a "table" (literally with borders) ?

In J strings of different lengths must be "boxed" if you want to make a list out of them.  So I take boxed strings as the input, and since the output requires grouping them, we have a list of boxes each of which contains a list of boxes.  The borders you see are just the default way J displays boxed data (it's configurable).  The other alternative would be to box the input within my function and return a list of boxed strings, where each string could have multiple words.  This felt less consistent to me, though.


text:
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 make your own question!

I'll try to think of something that isn't too close.

@TRiG, GAA would be identical, just using base-3 instead of base-6.

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, yeah, Compromised Rules might work but to make it a bit more different you could include draws & tie-breakers.

My TODO list now includes finding out how scoring works in Shinty, Shinty-Hurling, and Super11s Huring, and then producing some sort of super question including all these related games, @Shaggy.

Jelly, 3 bytes
ḅ6M

A monadic Link accepting a list of lists of integers, [[g1,b1],[g2,b2]], which yields a list [1] or [2].
(Draws would yield [1,2])
...Or a full program printing 1 or 2.
Try it online! Or see the test-suite.
How?
ḅ6M - Link: list of lists of integers, X
 6  - literal six
ḅ   - convert (X) from base 6 (vectorises)
  M - maximal indices

International Phonetic Esoteric Language, 12 bytes (WIP language) (OLD)
6ɪθɪt6ɪθɪtʈo

Outputs 1 for true and 0 for false.
No TIO interpreter yet, but is runnable by cloning the repository above, and calling python main.py "code here".
The TL;DR of the language is that it's a stack-based language where every instruction is a character from the International Phonetic Alphabet.
Takes in arguments as 4 inputs from STDIN, in the order g1, b1, g2, b2. Might be golfed down to less than 12 bytes once loops are fully implemented.
6ɪθɪt6ɪθɪtʈo
6            ; Push 6
 ɪ           ; Take number input, push
  θ          ; Pop 2, multiply, push
   ɪ         ; Take number input, push
    t        ; Pop 2, add, push
     6       ; Push 6
      ɪ      ; Take number input, push
       θ     ; Pop 2, multiply, push
        ɪ    ; Take number input, push
         t   ; Pop 2, add, push
          ʈ  ; Pop 2, if a > b push 1, otherwise 0
           o ; Pop, print

kuːl ˈlæŋgwɪʤ, djuːd!

aɪ əm nɑːt əˈmjuːzd baɪ ðə hʊd; bɪˈniːθ ɪt ɪz ˈsɪmpli dʒʌst əˈnʌðər stæk-beɪst ˈlæŋɡwɪdʒ. aɪ ˈstrɒŋli dɪsˈkɜːrɪdʒ ju tu ʌpvoʊt ðɪs ˈænsər.

CP-1610 assembly (Intellivision), 9 DECLEs1 ≈ 12 bytes
A routine taking input in R0 (\$g_1\$), R1 (\$b_1\$), R2 (\$g_2\$) and R3 (\$b_2\$) and setting the sign flag if the 2nd team wins, or clearing it otherwise.
275   PSHR  R5        ; push return address
110   SUBR  R2,   R0  ; R0 -= R2
082   MOVR  R0,   R2  ; R2 = R0
04C   SLL   R0,   2   ; R0 <<= 2
0D0   ADDR  R2,   R0  ; R0 += R2
0D0   ADDR  R2,   R0  ; R0 += R2
0C8   ADDR  R1,   R0  ; R0 += R1
118   SUBR  R3,   R0  ; R0 -= R3
2B7   PULR  R7        ; return
The CP-1610 has no multiplication instruction and may only shift by 1 or 2 positions at a time, so we compute the following expression instead:
((R0 - R2) << 2) + (R0 - R2) + (R0 - R2) + R1 - R3

Full test code
          ROMW    10              ; use 10-bit ROM width
          ORG     $4800           ; map this program at $4800

          ;; ------------------------------------------------------------- ;;
          ;;  test code                                                    ;;
          ;; ------------------------------------------------------------- ;;
main      PROC
          SDBD                    ; set up an interrupt service routine
          MVII    #isr,     R0    ; to do some minimal STIC initialization
          MVO     R0,       $100
          SWAP    R0
          MVO     R0,       $101

          EIS                     ; enable interrupts

          SDBD                    ; R4 = pointer to test cases
          MVII    #@@data,  R4
          MVII    #$200,    R5    ; R5 = backtab pointer

@@loop    PSHR    R5              ; save R5 on the stack
          MVI@    R4,       R0    ; load the next test case
          MVI@    R4,       R1    ; into R0 .. R3
          MVI@    R4,       R2
          MVI@    R4,       R3
          CALL    score           ; invoke our routine
          BMI     @@true

          MVII    #$80,     R0    ; set output to '0'
          B       @@output

@@true    MVII    #$88,     R0    ; set output to '1'

@@output  PULR    R5              ; restore R5
          MVO@    R0,       R5    ; draw the output

          SDBD                    ; was it the last test case?
          CMPI    #@@end,   R4
          BLT     @@loop          ; if not, jump to @@loop

          DECR    R7              ; loop forever

@@data    DECLE   1, 0, 0, 1      ; test cases
          DECLE   2, 0, 0, 11
          DECLE   10, 8, 11, 1
          DECLE   0, 0, 1, 0
          DECLE   100, 100, 117, 0
          DECLE   7, 7, 5, 12
          DECLE   2, 0, 0, 13
@@end     ENDP

          ;; ------------------------------------------------------------- ;;
          ;;  ISR                                                          ;;
          ;; ------------------------------------------------------------- ;;
isr       PROC
          MVO     R0,       $0020 ; enable display

          CLRR    R0
          MVO     R0,       $0030 ; no horizontal delay
          MVO     R0,       $0031 ; no vertical delay
          MVO     R0,       $0032 ; no border extension
          MVII    #$D,      R0
          MVO     R0,       $0028 ; light-blue background
          MVO     R0,       $002C ; light-blue border

          JR      R5              ; return from ISR
          ENDP

          ;; ------------------------------------------------------------- ;;
          ;;  routine                                                      ;;
          ;; ------------------------------------------------------------- ;;
score     PROC
          PSHR    R5              ; push the return address

          SUBR    R2,       R0    ; R0 -= R2
          MOVR    R0,       R2    ; R2 = R0
          SLL     R0,       2     ; R0 <<= 2
          ADDR    R2,       R0    ; R0 += R2
          ADDR    R2,       R0    ; R0 += R2
          ADDR    R1,       R0    ; R0 += R1
          SUBR    R3,       R0    ; R0 -= R3

          PULR    R7              ; return
          ENDP

Output

screenshot from jzIntv

1. A CP-1610 opcode is encoded with a 10-bit value, known as a 'DECLE'. This routine is 9 DECLEs long.

Python 3, 26 bytes
lambda g,b,G,B:6*g+b>6*G+B

Try it online!
Not incredibly interesting answer.

Cascade, 16 bytes
#6&
>
 |/
 +
* &

Try it online!
Reuses the same 6*a+b logic for both teams then prints whether the first scores higher than the other

C# (Visual C# Interactive Compiler), 22 bytes
(a,b,c,d)=>a*6+b>c*6+d

Try it online!

Also works in JS.

Or Java by changing the => to ->

Clean, 34 bytes
import StdEnv
$a b c d=a*6+b>c*6+d

Try it online!
Defines $ :: Int Int Int Int -> Bool with arguments taken like $ g1 b1 g2 b2

Perl 6, 13 bytes
*×6+*>*×6+*

Try it online!
Takes input as 4 integers, and basically just does as the question asks

J, 12 bytes
>&(1#.6 1*])

Try it online!

Scratch 3.0 17 16 blocks, 160 143 bytes
Score comes from proposed scoring method here
1 block/17 bytes saved thanks to @A (or Uzer_A on scratch)_

Try it on Scratch
As Scratchblocks:
when gf clicked
repeat(2
ask[]and wait
set[m v]to((answer)*(6)
ask[]and wait
change[m v]by(answer
add(m)to[x v
end
say<(item(1) of [x v]) > (m)

Answer History

Pretty much a port of my Keg answer.
Try it on Scratch
Input is in the form of g1, b1, g2, b2
In Scratchblocks syntax
when gf clicked
repeat(0
set[m v]to(0
ask[]and wait
change[m v]by((answer)*(6)
ask[]and wait
change[m v]by(answer
add(m)to[x v
end
say<(item(1) of [x v]) > (m)

Now I know what you're saying... why golf in scratch?!?
Well, it's fun. That's why. Also, Scratch is unique in that it isn't very often featured here on CGCC.

51 bytes?

33, 22 bytes
6OxcOasz6OxcOaclmzh1co

Try it online!
Takes the input as 4 delimited integers, and returns 0 for the first team winning, 1 for the second.
Explanation:
6Oxc                   | Multiplies the first number by 6
    Oa                 | Adds the second number
        6Oxc           | Multiplies the third number by 6
            Oa         | Adds the fourth number
      sz      clmz     | Subtract this from the first team's score
                  h1co | Print 0 if the first team's score is greater, 1 otherwise

-4 bytes if nondistinct results are allowed:
6OxcOasz6OxcOaclmo

Will output the score difference; positive results mean the first team win, negative means the second team win.

Scala, 11 bytes
_*6+_>_*6+_

Try it online!
Takes 4 Integers in the order of g1 b1 g2 b2.

brainfuck, 45 38 36 32 29 28 bytes
,[>,[<++++++>-],]-[[-<]>>]>.

Try it online!
Thanks to @Jo King for -8 bytes
Input is b1, g1, b2, g2 (goals and behinds are exchanged)
Prints þ, if team 1 won. Prints null, if team 2 won.
code:
[tape: p1, p2, print marker]

[Get input and calculate scores]
,               input behinds of team 1
[               while input
  >,                go to next cell and input goals of team
  [<++++++>-]       add it 6 times to behinds
,]              repeat this with the second pair of values

[Determine, which one is better]
-               set print marker
[               while score of both teams is greater than zero
  [-<]              decrement and go to previous cell (team 1 or empty cell/in the first run, it will decrement the print marker a second time)
  >>                return to team 2 (or two cells to the right of the first team that became 0)
]
>               go one cell right. If team 1 won, we are at the print marker now
                If team 2 won, we are one cell right of the print marker
.           Print that

I dont think this works with inputs greater than 10, but a great solution anyway. (Would note it down still). Might give a try to outgolf that later :)

Yes, inputs greater than 9 are at least a bit tricky, because the code only uses one character per input. You need to use the next ASCII characters (:;<=>? etc.) if you want to enter higher scores.

Is "input as character code except null" an option? Plus, both scores must be equal, when being integer-divided by 256, at least when you use tio.

Keg, 10 bytes (SBCS)
(2|¿¿6*+)>

Try it online!
As an Australian, I approve of this question.
Input taken as:
b1
g1
b2
g2

And 0 means team 2 and 1 means team 1
Explained
(2| #twice
¿¿  #get input in the form of bn, gn where n is the team number
*6+ #multiply the goals by 6 and add the values
)>  #compare the two values to determine the winner

C (gcc), 39 35 31 26 bytes
e(a,b,c,d){a=(a-c)*6>d-b;}

0 is false
1 is true
Input to function is (g1, b1, g2, b2)
Thanks to Doorknob for -5 bytes
Try it online!

You can remove the space after return, but you can also abuse an implementation detail for 26 bytes.

Zsh, 19 bytes
try it online!!
((6*$1+$2>6*$3+$4))

Input order is g1 b1 g2 b2. Exit codes 0==true and 1==false

05AB1E, 6 5 bytes
6δβZk

Input as a nested list [[g1,b1],[g2,b2]]. Output 0 if team 1 wins and 1 if team 2 wins.
-1 byte thanks to @Grimy for reminding me about δ.
Try it online or verify all test cases.
Explanation:
Apparently arbitrary base conversion on nested lists doesn't work without an explicit map outer product.
 δβ    # Apply arbitrary base-conversion double-vectorized,
6      # using the (implicit) input-list of lists and 6 as base
       # (i.e. [a,b] becomes 6a+b (or to be more precise: 6¹a + 6⁰b))
   Z   # Get the maximum of this mapped list (without popping the list itself)
    k  # And get the 0-based index of this maximum in the mapped list
       # (after which the top of the stack is output implicitly as result)

Brain-Flak, 62 bytes
([((({})({}){}){}{}[(({})({}){}){}{}]<(())>)(<>)]){({}())<>}{}

Outputs 1 if the first team lost, and 0 if they won (or tied).
Try it online!
# Input: G B g b

   (                                 <(())>)                   # Push 1 under...
    ({})({}){}){}{}                                            #   6G + B
                   [                ]                          #   Minus
                    (({})({}){}){}{}                           #   6g + b
                                             <>                # Switch stacks
([(                                         (  )])             # Push 0 under -(6G+B-6g+b)
                                                   ({}())<>    # Add 1 and switch stacks...
                                                  {        }   #   until one stack reaches 0
                                                            {} # Pop, leaving either 1 or 0

PowerShell, 35 bytes
param($g,$b,$h,$c)$g*6+$b-gt$h*6+$c

Try it online!

Alternative 35 bytes

Poetic, 751 bytes
the game:a game o soccer
for a moment of my fun,i kicked my leg
o,i hurt a player
o.m.gee,o no
suddenly i then apologized a little
o.m.gee,o no
but really,i loved a good soccer battle
a game i am doing,i love it
there is a game,a twenty-to-one unwinnable match(as we called it,i mean)a match we won
a wonder of an event i saw
i played,i go in again
i am happy in a match-up of teams,i am pumped
then o,a coach i saw played soccer
i know i do admire a game o soccer
o,a match was not a bummer,and also i am making in an extra score
i think i saw a split net,a hole i ripped out a net
i am ready to win a match
o,my people and i love a sport,a bit o soccer
i am going in a game,i score,i win
o really,i am doing a game o soccer
play ball
i am gonna wi-n

Try it online!
Boy, this was a tough one to write.
Input is in the following format:
g1
b1
g2
b2

This gives the error code of "Mismatched IF/EIF" if the first team wins, and "Unexpected EOF" if the second team wins. (Incidentally, a tie is treated as the second team winning).

Retina 0.8.2, 34 bytes
\d+
$*
(1*),
$1$1$1$1$1$1
(1*);\1$

Try it online! Link includes test cases. Outputs 1 if the second team doesn't win and 0 if it does. Explanation:
\d+
$*

Convert the input to unary.
(1*),
$1$1$1$1$1$1

In each pair, multiply the first number by six and add the second.
(1*);\1$

Check whether the second number is greater than the first. Alternatively, you could use ^(1*);\1 which would output 0 if the first team wins and 1 if it doesn't.

ABC-assembler, 111 74 bytes
.o 0 4 iiii
f
	subI
	pushI 6
	mulI
	addI
	subI
	pushI 0
	ltI
.d 0 1 b
	rtn

Try it online!
It doesn't use anything above the most basic stack operations:
subI    | B = [g1-g2,b1,b2]
pushI 6 | B = [6,g1-g2,b1,b2]
mulI    | B = [6*g1-6*g2,b1,b2]
addI    | B = [6*g1+b1-6*g2,b2]
subI    | B = [6*g1+b1-6*g2-b2]
pushI 0 | B = [0,6*g1+b1-6*g2-b2]
ltI     | B = [0<6*g1+b1-6*g2-b2]

PHP (7.4), 32 bytes
fn($g,$b,$G,$B)=>$g+$b/6>$G+$B/6

Try it online!

Perl 5, 18 bytes
say<>*6+<>><>*6+<>

Try it online!
Input is line separated:
g1
b1
g2
b2

Wolfram Language (Mathematica), 13 bytes
6#+#2>6#3+#4&

Try it online!
straightforward and boring

Whitespace, 115 bytes
[S S S N
_Push_0][S N
S _Duplicate_0][T   N
T   T   _STDIN_as_integer][T    T   T   _Retrieve_integer][S S S T  T   S N
_Push_6][T  S S N
_Multiply][S N
S _Duplicate][S N
S _Duplicate][T N
T   T   _STDIN_as_integer][T    T   T   _Retrieve_integer][T    S S S _Add][S N
S _Duplicate][S N
S _Duplicate][T N
T   T   _STDIN_as_integer][T    T   T   _Retrieve_input][S S S T    T   S N
_Push_6][T  S S N
_Multiply][S N
S _Duplicate][S N
S _Duplicate][T N
T   T   _STDIN_as_integer][T    T   T   _Retrieve_input][T  S S S _Add][T   S S T   _Subtract][N
T   T   N
_If_negative_jump_to_Label_NEGATIVE][S S S N
_Push_0][T  N
S T _Print_as_integer][N
N
N
_Exit_Program][N
S S N
_Label_NEGATIVE][S S S T    N
_Push_1][T  N
S T _Print_as_integer]

Letters S (space), T (tab), and N (new-line) added as highlighting only.
[..._some_action] added as explanation only.
Prints 0 if team 1 wins and 1 (could also be -1 for the same byte-count) if team 2 wins.
Try it online (with raw spaces, tabs and new-lines only).
Explanation in pseudo-code:
Integer g1 = STDIN as integer
Integer t1 = g1*6
Integer b1 = STDIN as integer
t1 = t1 + b1
Integer g2 = STDIN as integer
Integer t2 = g2*6
Integer b2 = STDIN as integer
t2 = t2 + b2
If(t1 - t2 < 0):
  Goto NEGATIVE
Print 0
Exit program

Label NEGATIVE:
  Print 1
  (implicitly exit with an error)

One minor note: since the inputs are guaranteed to be \$\geq0\$, I'm using that to my advantage to re-use the inputs as heap-addresses for the subsequent inputs. With challenges which can have negative inputs I'd have to re-push 0 as heap-address, since heap-addresses cannot be negative.

Japt, 6 bytes
Input as a 2D-array. Outputs 1 for team 1, 0 for a draw or -1 for team 2.
mì6 rg

Try it
mì6 rg     :Implicit input of array
m          :Map
 ì6        :  Convert from base-6 digit array
    r      :Reduce by
     g     :  Sign of difference

Ruby, 21 bytes
->a,b,x,y{b-y>6*x-=a}

Try it online!
Worked around the boring solution, saved a byte and called it a day.

SimpleTemplate, 84 bytes
Just the simple "multiply by 6, sum and compare" aproach, except the math support is extremelly lacking.
{@set*A argv.0,6}{@incbyargv.1 A}{@set*B argv.2,6}{@incbyargv.3 B}0{@ifB is lowerA}1

Outputs 0 for false and 01 for true.

Ungolfed:
{@// multiply the first argument by 6}
{@set* teamA argv.0, 6}

{@// add the 2nd argument to the previous result}
{@inc by argv.1 teamA}

{@// same as before, for argument 3 and 4}
{@set* teamB argv.2, 6}
{@inc by argv.3 teamB}

{@echo 0}
{@// alternative: teamA is greater than teamB}
{@if teamB is lower than teamA}
    {@echo 1}
{@/}

Everything should be clear with the comments ({@// ... }) added.

Go, 44 bytes
func f(a,b,x,y int)bool{return a*6+b>=x*6+y}

Try it online!

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!
readable version:
lstl        call readint
sssttsl     push 6
tssl        mult
lstl        call readint
tsss        add
lstl        call readint
sssttsl     push 6
tssl        mult
lstl        call readint
tsss        add
tsst        sub
sssl        push 0
slt         swap
lttsl       jn otherteam
ssstl       push 1
lsssl       otherteam:
tlst        printi
lll         end

lssl        readint:
sssl        push 0
sls         dup
tltt        readi
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!


text:
Sort with a neural network
The previous neural net golfing challenges (this and that) inspired me to pose a new challenge:
The challenge
Find the smallest feedforward neural network such that, given any 4-dimensional input vector \$(a,b,c,d)\$ with integer entries in \$[-10,10]\$, the network outputs \$\textrm{sort}(a,b,c,d)\$ with a coordinate-wise error strictly smaller than \$0.5\$.
Admissibility
For this challenge, a feedforward neural network is defined as a composition of layers. A layer is a function \$L\colon\mathbf{R}^n\to\mathbf{R}^m\$ that is specified by a matrix \$A\in\mathbf{R}^{m\times n}\$ of weights, a vector \$b\in\mathbf{R}^m\$ of biases, and an activation function \$f\colon\mathbf{R}\to\mathbf{R}\$ that is applied coordinate-wise:
$$ L(x) := f(Ax+b), \qquad x\in\mathbf{R}^n. $$
Since activation functions can be tuned for any given task, we need to restrict the class of activation functions to keep this challenge interesting. The following activation functions are permitted:

Identity. \$f(t)=t\$
ReLU. \$f(t)=\operatorname{max}(t,0)\$
Softplus. \$f(t)=\ln(e^t+1)\$
Hyperbolic tangent. \$f(t)=\tanh(t)\$
Sigmoid. \$f(t)=\frac{e^t}{e^t+1}\$

Overall, an admissible neural net takes the form \$L_k\circ L_{k-1}\circ\cdots \circ L_2\circ L_1\$ for some \$k\$, where each layer \$L_i\$ is specified by weights \$A_i\$, biases \$b_i\$, and an activation function \$f_i\$ from the above list. For example, the following neural net is admissible (while it doesn't satisfy the performance goal of this challenge, it may be a useful gadget):
$$\left[\begin{array}{c}\min(a,b)\\\max(a,b)\end{array}\right]=\left[\begin{array}{rrrr}1&-1&-\frac{1}{2}&-\frac{1}{2}\\1&-1&\frac{1}{2}&\frac{1}{2}\end{array}\right]\mathrm{ReLU}\left[\begin{array}{rr}\frac{1}{2}&\frac{1}{2}\\-\frac{1}{2}&-\frac{1}{2}\\1&-1\\-1&1\end{array}\right]\left[\begin{array}{c}a\\b\end{array}\right]$$
This example exhibits two layers. Both layers have zero bias. The first layer uses ReLU activation, while the second uses identity activation.
Scoring
Your score is the total number of nonzero weights and biases.
(E.g., the above example has a score of 16 since the bias vectors are zero.)

@Close-voter: What exactly is unclear? I don't think either of the previous NN challenges was so well specified.

Are skip connections (NOT feedback connections) allowed?

No - skip connections are not allowed.

@flawr It's probably just because of the high level of knowledge and math that is required. I don't have a specific idea of what the question is asking, so I am not qualified to know whether it is unclear or not.

@DustinG.Mixon Out of curiosity: Did you construct the max/min network yourself or did you find it somewhere else?

@flawr - I constructed it myself. It may not be minimal.

@DustinG.Mixon I actually just found an approach for the max/min that only uses 15 weights instead of 16, but it is considerably less elegant:)

This is a nicely specified challenge that I think could serve as a model for future neural-network challenges.

I personally find it difficult to optimize without skipping connections. This is because a sorting NN is required to output numbers close enough to the inputs. So it seems necessary to 'remember' / 'reconstruct' the inputs across layers. I do not see how that could be done easily once $e^t$ is involved since there are no inverses of those functions allowed as activations. So we are only left with the ReLUs for which the baseline (with minor improvements as shown in flawr's answer) is already near optimal.

@Joel I agree, more flexibility in the architecture would have made this a more interesting challenge. I guess the drawback with allowing e.g. skip connections is that the specs would be a lot more complicated.

Another alternative is to allow outputting the indices of sorted inputs (i.e. argsort) rather than the actual sorted inputs. That would also avoid the need of reconstructing the inputs entirely.

Octave, 96 88 87 84 76 54 50 weights & biases
This 6-layer neural net is essentially a 3-step sorting network built from a very simple min/max  network as a component. It is basically the example network from wikipedia as shown below, with a small modification: The first two comparisons are done in parallel. To bypass negative numbers though the ReLU, we just add 100 first, and then subtract 100 again at the end.

So this should just be considered as a baseline as it is a naive implementation. It does however sort all possible numbers that do not have a too large magnitude perfectly. (We can adjust the range by replacing 100 with another number.)
Try it online!
max/min-component
There is a (considerably less elegant way more elegant now, thanks @xnor!) way to find the minimum and maximum of two numbers using less parameters:
$$\begin{align} \min &= a - ReLU(a-b) \\ \max &= b + ReLU(a-b) \end{align}$$
This means we have to use a lot less weights and biases.
Thanks @Joel for pointing out that it is sufficient to make all numbers positive in the first step and reversing it in the last one, which makes -8 weights. Thanks @xnor for pointing out an even shorter max/min method which makes -22 weights! Thanks @DustinG.Mixon for the tip of combining certain matrices which result in another -4 weights!
function z = net(u)
a1 = [100;100;0;100;100;0];
A1 = [1 0 0 0;0 0 1 0;1 0 -1 0;0 1 0 0;0 0 0 1;0 1 0 -1];
B1 = [1 0 -1 0 0 0;0 0 0 1 0 -1;0 1 1 0 0 0;0 0 0 0 1 1];
A2 = [1 0 0 0;0 1 0 0;1 -1 0 0;0 0 1 0;0 0 0 1;0 0 1 -1];
A3 = [1 0 -1 0 0 0;0 1 1 0 0 0;0 0 0 1 0 -1;0 1 1 -1 0 1;0 0 0 0 1 1];
B3 = [1 0 0 0 0;0 1 0 -1 0;0 0 1 1 0;0 0 0 0 1];
b3 = -[100;100;100;100];
relu = @(x)x .* (x>0);
id = @(x)x;
v = relu(A1 * u + a1);
w = id(B1 * v) ;
x = relu(A2 * w);
y = relu(A3 * x);
z = id(B3 * y + b3);
% disp(nnz(a1)+nnz(A1)+nnz(B1)+nnz(A2)+nnz(A3)+nnz(B3)+nnz(b3)); %uncomment to count the total number of weights
end

Try it online!

The constant offsets are basically used to make the inputs non-negative. Once done in the first layer, all intermediate outputs of the comparison blocks are non-negative and it suffices to change it back only in the last layer.

Might you get a shorter min-max gadget with (a - relu(a-b), b + relu(a-b))?

@joel Oh now I see, that makes a lot of sense:)

@xnor Thanks a lot that makes a huge difference!!!!

Looks like you can shave off another 2 weights by multiplying A3*B2 instead of applying them in series.

Inconsequential nitpick: The score for the first bias is nnz(A1*a0), not nnz(a0). (Or else we must pay the price of an identity matrix.) These numbers are the same in this case.

@DustinG.Mixon Thanks for the hint, I was able to fix it by omitting the first identity alltogether!


text:
Replace by most recent nonzero
Given a non-empty list of decimal digits (0, 1, ..., 9), replace each zero by the most recent nonzero, if possible.
Example 1: given
1 4 3 0 0 7 5 5 0 3

the output should be
1 4 3 3 3 7 5 5 5 3

Note how the first two zeros are replaced by 3, which is the most recent (i.e. rightmost) nonzero. Similarly, the last zero is replaced by 5.
Example 2: given
0 0 4 0 0 5 0

the output should be
0 0 4 4 4 5 5

Note how it is not possible to replace the first two zeros, because there isn't a nonzero number to the left ot them.
Additional rules

Input can be taken by any reasonable means. Format is flexible as usual. In particular, it can be a list of numbers, an array, a string representation of an array, a string of digit characters ...
Programs or functions are allowed, in any programming language. Standard loopholes are forbidden.
Shortest code in bytes wins.

Test cases
Input, then output
1 4 3 0 0 7 5 5 0 3
1 4 3 3 3 7 5 5 5 3

0 0 4 0 0 5 0
0 0 4 4 4 5 5

0 0 0
0 0 0

0
0

0 1
0 1

4 2 1 0
4 2 1 1

8 0 0 0 6
8 8 8 8 6

Dupe? I think this challenge is generally worded better but I'm not sure being single positive digits and leading zeros changes the result in enough languages.

@Fry I’m not sure. I didn’t remember yours. But the leading zeros do make a difference. What do others think?

Three votes for a dupe from Code-Gold members is enough for me.

@Adm I changed my mind (and edited my comment) because of the leading zeros. But I’m not sure that makes it different enough. You are probably right

@FryAmTheEggman Your challenge is based on a SO question and the accepted answer there is mine :-) I really should have remembered!

@LuisMendo Yeah! But I figured nearly 4 years was long enough that I could forgive you ;)

I was actually going to post this challenge, but I figured "eh, someone's probably already done it" - turns out I also posted an answer on that 4 years ago :P

@Doorknob Heh, your memory is as bad as mine is

JavaScript (ES6),  22  21 bytes
A=>A.map(x=>A=x||~~A)

Try it online!
Commented
A =>          // A[] = input array
  A.map(x =>  // for each value x in A[]:
    A =       //   update A to:
      x ||    //     either x, if it's not equal to 0
      ~~A     //     or A coerced to an integer otherwise
  )           // end of map()

Because we're re-using the input array \$A[\:]\$ to store the last non-zero value, two special cases arise if the 2nd part of the condition is executed on the 1st iteration:

if \$A[\:]\$ is a singleton array containing \$0\$, ~~A is equal to ~~0
if \$A[\:]\$ is an array of several elements (starting with \$0\$), ~~A is equal to ~~NaN

which gives the expected \$0\$ in both cases.

Mathematica, 19 17 bytes
f@x_:=f@0=x;Map@f

Try it online!
Inspired by kglr's answer to a question on Mathematica Stack Exchange, which I assume was the inspiration for this challenge. :)
In the body of f, the value of f[0] is redefined to be the input, which is also returned. That way, whenever f is called with 0 after the first time it's called, it will always yield the "remembered" result, which is updated when f is called again with a nonzero argument.
Thanks to @attinat for 2 bytes.
mikado's answer yields a 20 byte solution:
FoldList[#2/. 0->#&]

simple -2 bytes with @ instead of [ ]

Perl 5 -p, 21 bytes
s/([^0])0/$1$1/&&redo

Try it online!

Here's another 21, using math.

@Grimy Interesting idea, but it doesn't seem to work if the preceding digit is a nine: Try it online!

Right, my bad. It takes at least 2 bytes to fix it, so it's not worth it.

Jelly, 3 bytes
ȯ@\

Try it online!
-2 bytes thanks to FryAmTheEggMan (it's close to being an entirely new solution because 5 -> 3 bytes is a 40% deduction and that's like half the code lol)
Explanation
ȯ@\  Main Program
  \  Cumulative Reduce
ȯ@   Logical OR (inverted; basically "right OR left")

K (ngn/k), 11 bytes
{$[y;y;x]}\

Try it online!
{ }\ scan - starting with the first element, apply the function in { } between the current result and the next element. collect intermediate results in a list.
$[y;y;x] cond - if the right argument y is truthy (not 0), return it, otherwise return the left argument x

05AB1E, 5 bytes
ηε0†θ

Try it online!
For each prefix of the input, filter 0s to the front, then get its last digit. Yes, filter-to-the-front is somehow a single-byte built-in (†). I didn't think I'd ever need it, but here we are.

Java 10, 65 bytes
s->{while(!s.equals(s=s.replaceAll("(.) 0","$1 $1")));return s;};

A Function that repeatedly replaces "N 0" with "N N" until such time as the String stops changing, then returns it.


text:
Injection from two strings to one string
Challenge
Write a program that applies an injective function which takes an ordered pair of strings as input and one string as output. In other words, each input must map to a unique output.
Specifics

The input may be any two strings of arbitrary length, but will consist only of printable ASCII characters (codes \$[32, 126]\$).
Similarly, the output string has no length restriction, but it must consist only of printable ASCII characters.
If your language can't handle arbitrary-length strings, the program may merely work theoretically for strings of any size.
The mapping from inputs to outputs should be consistent between executions of the program. Otherwise, the mapping you use is completely up to you, as long as it is an injection.
The input is ordered. If the two input strings are different, they should produce a different output than if they were swapped. \$s \neq t \implies f(s, t) \neq f(t, s)\$
Not every string needs to be a possible output.
The shortest answer in each language wins!

Test cases
The following inputs should all result in different outputs. To avoid confusion, strings are surrounded by guillemets («») and separated by single spaces.

«hello» «world»
«lelho» «drowl»
«diffe» «_rent»
«notth» «esame»

«Code» «Golf»
«Co» «deGolf»
«CodeGolf» «»

«» «»
«» « »
« » «»
« » «  »
«  » « »

«abc", » «def»
«abc» «, "def»
«abc' » «'def»
«abc'» « 'def»

«\» «"»
«\\» «\"»

Hmm I just noticed "Write a program that..." - note that by meta consensus (currently 46 up, 1 down) "Restricting to just programs requires explicitly specifying "full program" rather than just "program"". I hope you did not mean to try to restrict this, but if you did you'll need to update the post accordingly and address those of us which have already submitted functions as answers.

If our language can only take input from STDIN may we choose to reserve one printable character as our string separator?

I do wish I had noticed that "stringify" works as a solution while this was in the sandbox, as it does seem to make the challenge a bit worse. I still think this is a good challenge for languages that don't really have string support.

@FryAmTheEggman I feel bad -- I noticed a weaker string-representation idea in the Sandbox, but hadn't thought through how short and general it can be.

@xnor Don't worry too much, after all I missed it too! But I guess the lesson is to explain algorithms in the sandbox even if they feel like they might not be great. This is definitely the kind of problem that can always slip though, though, so I'm not sure even if you had that anyone would've noticed before it got posted here.

@JonathanAllan The intent was to allow functions.

@JonathanAllan Using a printable character separator is fine in that case, as long as it isn't chosen specifically to make handling the input strings easier.

Can either of the strings be empty?

@Shaggy Yes, either or both can.

Can we have some test cases? Thanks!

brainfuck, 30 29 27 23 bytes
,[-[+.>]-[>+<---]>.-.,]

Try it online!
Inputs are separated by a 0x01 byte.
This turns ["foo", "bar"] into fUToUToUTUTbUTaUTrUT. To recover the original two strings, take groups of 3 characters, find the one where the second letter isn't U, and split there.

@Grimy Sorry, misunderstood "Inputs are separated by a 0x01 byte."

JavaScript (ES6), 14 bytes
Takes input as an array of 2 strings. Inspired by Luis' answer.
JSON.stringify

Try it online!

JavaScript (ES6),  21  20 bytes
Takes input as (a)(b).
a=>b=>[a.length,a]+b

Try it online!
Returns the length of \$a\$, followed by a comma, followed by the concatenation of \$a\$ and \$b\$.

Goddamnit! Was just about to use the stringify trick myself!

Breaks with a="hello","" b="world" and a="hello" b="","world"

@Soleil That would give ["\"hello\",\"\"","\"world\""] and ["\"hello\"","\"\",\"world\""].

@Arnauld the backslash protection won't be visible. The function won't inject.

@Soleil I don't understand what you mean. JSON.stringify() definitely escapes ". See a hex dump.

jq -c, 0 bytes

Try it online!
This definitely feels like cheating...? But it seems to comply with the rules of the challenge.
By default, jq will output its input in a human-readable JSON format. The -c (compact) flag tells jq to output in "compact" style, which removes the newlines (since the challenge forbids non-printable ASCII).

OP allows empty input, so wouldn't a="", b="x" give same output as a="x" b=""

@Gnudiff How so? They would give ["","x"] and ["x",""] respectively

Sorry, you're right.

Python 3, 3 bytes
str

A (built-in) function which, given a list of the two strings, gives a string representation of the list
Try it online!

More pithy than Pyth...

Well, the 1 byte Pyth solution ` does the same thing.

Japt -S, 3 bytes
I still feel I must be missing something here ...
®mc

Try it
Possibly 2 bytes:
mq

Try it
Or stretching it with this 1-byter:
U

Try it
The first version maps each string in the array to its codepoints and outputs them joined with a space.
The second version splits each string to a character array and outputs them joined with a space.
And the third version, which feels like cheating, just outputs the input with the -Q flag doing the heavy lifting of srringifying it.

Pyth, 4 bytes
jNmC

Try it online!
This converts each string to base 256 and then joins them in order with a ". Since the results are each numbers the " unambiguously separates them and the original strings can be recovered with mCsdczN.

@AndersKaseorg suggests a 1-byter.

@KevinCruijssen I've been aware of that since a few minutes after I posted this, I just prefer the spirit of this solution. Thanks for bringing it up anyway, and definitely feel free to post it yourself :)

I indeed like your answer more as well. :) And nah, I don't even know Pyth. If you want you can post it yourself as a separated answer (or a combined answer by editing this one), otherwise Anders Kaseorg can post it, since he's the one who mentioned it in the comment.

Haskell, 4 bytes
show

The Haskell built-in to turn things into strings. The input is taken as a pair of strings.
Try it online!

T-SQL, 38 bytes
SELECT QUOTENAME(a)+QUOTENAME(b)FROM i

Input is taken from a pre-existing table \$i\$ with varchar fields \$a\$ and \$b\$, per our IO rules.
Uses QUOTENAME, which surrounds the strings with [] and also escapes any internal brackets. Should map to a unique output.

Same length on MySQL: SELECT CONCAT(QUOTE(a),QUOTE(b))FROM t Try it online

Zsh, 7 bytes
<<<$@:q

Try it online!
Implicitly joins the arguments on spaces. The q modifier tells zsh to quote the arguments, which crucially escapes spaces, ensuring an unescaped space unambiguously separates the two arguments.
(Without q, "a " "b" and "a" " b" would both yield "a  b".)

MATL, 1 byte
j

The code takes an array of two strings as input, and outputs a string representation of that array.
Try it online!
Explanation
The code simply reads the input as a string, unevaluated.

Does this really take two strings as input? It seems like this just prints the input whatever it is.Try it online!

@DJ It just reads unevaluated input, so it reads anything. Is it a loophole? A more standard approach would be to take the evaluated input as an array and then convert to string representation. But the result would be the same as my code, so I would argue that the distinction is unobservable

Jelly, 2 bytes
ŒṘ

A monadic Link accepting a list of two lists of characters as its argument which yields a single list of characters.
Try it online!
How?
It's a built-in to get Python's string representation, simples.

C# with 26 bytes (thanks to Lukas Lang, Kevin Cruijssen and Jo King)
a=>b=>$"{a.Length}.{a}{b}"

tio.run lambda

Please consider using https://tio.run

This still breaks on ("a<>","b") and ("a","<>b") - note that it is impossible to handle all cases if you're just concatenating the inputs, no matter what you put between/around them - you need to modify the strings somehow

Sadly, this will still not work - take e.g. ("a","bb") and ("abb","b")

Sorry, still not enough: take e.g. ("a","..") and ("a..",".")

("1","2b") and ("11","b") ;)

Sorry, still not: ("1","11111111111") and ("11111111111","1") - what does work on the other hand (and is even shorter) is this $"{a.Length}.{a}{b}" - you can always extract a and b from this without any ambiguity (just read until the first . to get the length of a, b is then the rest

@LukasLang Great. Thanks for the follow ups.

Welcome to CGCC! You can save an additional byte by using currying lambdas a=>b=> instead of (a,b)=>: a=>b=>$"{a.Length}.{a}{b}" Also, if you haven't seen it yet, tips for golfing in C# and tips for golfing in  might be interesting to read through. Enjoy your stay! :)

@KevinCruijssen that's Currying isn't it ? How do you declare the variable to store such function ? (for the current lambda it's Func<string, string, string>)

I asked because I tried, and it won't work: error CS1593: Delegate 'Func<string, Func<string, string>>' does not take 2 arguments @JoKing

Many thanks @JoKing !

05AB1E, 2 bytes
₁ö

Try it online!
Interprets each string as a base-256 integer, then prints the two in the form [1, 2].

05AB1E, 1 byte (unknown validity)
â

Try it online!
Takes the cartesian product of the input with itself. Quotes in the input are not escaped, which could cause confusion. I brute-forced all combinations of up to 12 ", " and "], [" and didn’t find any collision; however, I can’t prove there aren’t any collisions for longer strings. If anybody can come up with a proof or counter-example, I’d highly appreciate it!
The trivial 0-byter fails because of quotes not being escaped: inputs (", ", empty string) and (empty string, ", ") both yield the output ["", "", ""].
The 1-byter º (mirror each input string) also fails because of this: inputs (", "" ,", empty string) and (empty string, " ,"", ") both yield the output ["", "" ,"", "" ,"", ""].

Charcoal, 12 bytes
⪫Ｅ²⭆⪪Ｓ"⪫""λ,

Try it online! Link is to verbose version of code. Explanation:
 Ｅ²             Repeat twice
     Ｓ          Input a string
    ⪪ "         Split it on `"`s
   ⭆            Map over each piece and join
       ⪫""λ     Wrap each piece in `"`s
⪫          ,    Join the two results with a `,`
                Implicitly print

PowerShell, 22 bytes
Many fixes thanks to mazzy
"$($args|% le*)"+$args

Try it online!
Take five, oh my.

"ab" "c" and "a" "bc" both produce the same output.

@JoKing Things should be fixed. Hopefully.

15 bytes with $OFS?

R, 4 bytes
dput

Try it online!
A built-in function which returns the string representation of the input (inspired by Jonathan Allan's answer )

Wolfram Language (Mathematica), 8 bytes
Compress

Try it online!

{"Hello, ","World"} and {"Hello",", World"} don't they give the same string?

@NahuelFouilleul ah, nice catch. Compress it is then

Perl 6, 6 3 bytes
&dd

Try it online!
Outputs the object representation to STDERR.

I'm not familiar enough with Perl - how would you input a string containing spaces here?

@negativeseven like this

@negativeseven Yeah sorry, I was just using a shortcut syntax for lists of strings. You can do that in a typical fashion like ["Hello, ", "World!"]

CSS + HTML, 55 + 20 = 75 bytes
Provide the inputs in the HTML after  tags. Visually injects letters one by one from each input into the output. When an input is longer than the other one, visual spaces are shown for missing letter(s) of the shorter input. Also one comma is added in HTML to force visual output uniqueness (I hope).

*{position:absolute;letter-spacing:9px}code>code{left:9px
abcdefghijklmn,

C# (Visual C# Interactive Compiler), 5 bytes
Print

Try it online!

Why the downvote? My solution is perfectly valid

Lua, 27 bytes
print(('%q%q'):format(...))

Try it online!
Full program, take input as arguments.
Inspired by zsh answer, as it also use %q modifier to use internal safe-string engine.
Also, I can think of just
('%q%q'):format

but I'm not sure if this is acceptable answer.

I don't think the second is valid since ('%q%q'):format doesn't result in an object that can, for example, be assigned to a variable. It just causes a syntax error on its own. The colon syntax is just a shortcut for '%q%q'.format('%q%q', ...) and Lua doesn't allow partial application for functions

@JoKing Yeah, you are right, I think.

sed, 19 bytes
N
s/ /. /g
s/\n/: /

Try it online!
N          # append the second string into the pattern space
s/ /. /g   # prefix all spaces with ".". Now ": " will not occur in the stiring
s/\n/: /   # replace the newline with ": "

JavaScript (SpiderMonkey), 6 bytes
uneval

Try it online!
Input array of strings, output a single string.
Inspired by Arnauld's JSON.stringify answer.

C (gcc), 59 bytes
Thanks to Grimy for the suggestion.
Takes an array of input strings (of which "2" is the correct number for this challenge) and prints their character values, including the trailing NUL. Technically, the %p formatter used by printf is for pointers, but it works fine for displaying hex values of arbitrary integers if you're not picky about how they look!
f(s,t)char**s,*t;{for(;t=*s++;)for(;printf("%p",*t++)^5;);}

Try it online!

Nice! Here’s a 59.

Brachylog, 0 bytes

Input as an array of 2 strings, output in the format:
Z = ["{{string 1 stringified}}","{{string 2 stringified}}"]
Inspired by Arnauld's JSON.stringify answer and Doorknob's empty jq answer
Try it online!

PHP, 9 bytes
serialize

Try it online!
Input is an array of 2 strings like this: ['abc', 'def']. Uses PHP's serialize to serialize the input into a string.

Bash, 11 bytes
echo ${@@Q}

Try it online!
${parameter@Q} quotes the parameter for reuse as input. In the case of an array, it quotes each element.

Ruby, 12 bytes
->*a{a.to_s}

Try it online!


text:
Tips for golfing in 1+
What general tips do you have for golfing in 1+? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to 1+ (e.g. "remove unnecessary whitespace" is not an answer).
Please post one tip per answer.

This 1+?

@UnrelatedString Yes.

Are there actually any answers on this site that use 1+? I'm all for tips pages, but they don't seem necessary if no-one has ever even used the language here.

@cairdcoinheringaahing Oops. I will do it, then. (Though, because it's a Turing-tarpit, it would be very hard to do simple tasks for usual languages, e. g. ROT13.)

@cairdcoinheringaahing Also I have to say, because of my special geographic location, I'm without access to tumblr - and thus without access to the official interpreter. So all programs I made are not verified.

@TwilightSparkle Why is that hosted on Tumblr??? That's bizarre. Here's a Gist: https://gist.github.com/DJMcMayhem/c7186ae2890b5c8a54e38ba7a595a7d5

Subroutines can have empty names
(|1+1<) is a valid definition for a subroutine, invoked as ().

Instead of pushing 0 and compare, do something to other numbers
As 1 is the only literal in 1+ and there's no minus operation, pushing 0 would be expensive (11+1<). A better choice would be change other numbers, so 1 becomes a "relative" 0. For example, if you want to flip a bit, instead of 11+1<<, you can 1+1<.

Use comments for conditionals
Found this while exploiting interpreter features. Apparently Parcly Taxel thinks comments and conditionals are similar because both of them begins with "co". The comment indicators [] are actually instructions because there's no such thing called parsers in 1+.
This trick can sometimes save you and a few bytes from the comparison mess.
Found while exploiting interpreter features, then made a Truth-Machine with it.