-4
\$\begingroup\$

This question already has an answer here:

This is a very simple challenge, and it is to print the numbers -1, 0, and 1.

The following paragraph is credited to Print numbers from 1 to 10
Your output format can be whatever your language supports. This includes arbitrary separators (commas, semicolons, newlines, combinations of those, etc., but no digits), and prefixes and postfixes (like [...]). However, you may not output any other numbers than -1 through 1. Your program may not take any input. Standard loopholes are disallowed.

This is , so the shortest answer in bytes wins. Happy golfing!

\$\endgroup\$

marked as duplicate by Dennis code-golf Feb 21 '18 at 2:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 6
    \$\begingroup\$ I don't think we need one of these for all number ranges. \$\endgroup\$ – Dennis Feb 21 '18 at 2:56
  • \$\begingroup\$ @Dennis but all the others start at 0 or 1. plus, I'd also like to see if any get it in 2 bytes or less \$\endgroup\$ – robbie Feb 21 '18 at 3:00
  • 3
    \$\begingroup\$ Starting at -1 might be annoying for languages that have only unsigned integers, but it will make no difference whatsoever for all others. If you want to satisfy your 2-byte curiosity, you can join us in The Nineteenth Byte. \$\endgroup\$ – Dennis Feb 21 '18 at 3:06
  • 1
    \$\begingroup\$ Does this count? \$\endgroup\$ – ETHproductions Feb 21 '18 at 7:00
  • \$\begingroup\$ @ETHproductions yes! \$\endgroup\$ – robbie Feb 22 '18 at 1:54
2
\$\begingroup\$

Pyt, 4 bytes

3ř⁻⁻

Try it online!

Explanation:

3      Push 3
ř      Push [1,2,3]
⁻⁻     Decrement twice
       Implicit print
\$\endgroup\$
2
\$\begingroup\$

R, 9 bytes

cat(-1:1)

Try it online!

\$\endgroup\$
0
\$\begingroup\$

JavaScript, 19 15 bytes

[-1,0,1].map(alert)

alert([-1,0,1])

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.