Skip to main content
added 438 characters in body
Source Link
Command Master
  • 10.7k
  • 1
  • 11
  • 73

05AB1E, 8 bytes

X®‚xâ˜Â«

Try it online!

X     push an integer variable, which is initialized to 1 (using 1 makes it a string, which makes the output look weird)
®     push the register, which is initialized to -1
‚     pair, to get [1, -1]
x     push tos and itself doubled, to get [1, -1], [2, -2]
â     Cartesian product, all pairs
˜     Flatten, to get a list of coordinates instead of a list of pairs
     Push tos and itself reversed
«     Concatenate

05AB1E, 8 bytes

X®‚xâ˜Â«

Try it online!

05AB1E, 8 bytes

X®‚xâ˜Â«

Try it online!

X     push an integer variable, which is initialized to 1 (using 1 makes it a string, which makes the output look weird)
®     push the register, which is initialized to -1
‚     pair, to get [1, -1]
x     push tos and itself doubled, to get [1, -1], [2, -2]
â     Cartesian product, all pairs
˜     Flatten, to get a list of coordinates instead of a list of pairs
     Push tos and itself reversed
«     Concatenate
Source Link
Command Master
  • 10.7k
  • 1
  • 11
  • 73

05AB1E, 8 bytes

X®‚xâ˜Â«

Try it online!