Simulate move left for 2048
APL (Dyalog Unicode), 36 bytesSBCS



Anonymous tacit prefix function.

⎕UCS{4↑⍺⍺t⎕R(1⌽∪¨t←2/¨⍺⍺2*⍳16)⍺⍺⍵~0}


Try it online!

⎕UCS{…} derived function where ⍵ is the argument and ⍺⍺ converts to/from code points:

 ⍵~0 the argument without zeros

 ⍺⍺ convert to code points

 t⎕R(…) Replace the texts t (defined below) with the corresponding texts from:

  ⍳16 the indices from 1 to 16

  2* two raised to the power of those

  ⍺⍺ convert them to characters

  2/¨ make two of each

  t← assign to t

  ∪¨ get the unique element from each (i.e. deduplicate them)

  1⌽ cyclically rotate the first string to the end

 ⍺⍺ convert to code points

 4↑ take the first four elements, padding with zeros