-7
\$\begingroup\$

You know that 9+10 is 21, but someone challenges you saying that it isn't. You'll show them, though.

Have your program print 21 in the shortest code length possible. The only numeral characters you can use are the ones found in the left side of this equation: 9 + 10 = 21. That is, "9", "1", and "0".

Bonus: if you can do it without typing ANY numeral characters (i.e. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9) you get to subtract 5 bytes from your score.


Source: https://www.youtube.com/watch?v=OLBOn0Whhyc

\$\endgroup\$
9
  • 1
    \$\begingroup\$ I'd like to suggest posting challenge ideas in the Sandbox first to get some feedback from the community before "going live". \$\endgroup\$ – Dennis Oct 3 '15 at 6:44
  • 2
    \$\begingroup\$ Mouse-2002: C!B! for 4 - 5 = -1 bytes... i wish this was still open. \$\endgroup\$ – cat Dec 10 '15 at 1:13
  • 1
    \$\begingroup\$ @sysreq and I wish I didn't get 6 downvotes on this question.. haha :o \$\endgroup\$ – Albert Renshaw Dec 10 '15 at 3:11
  • 1
    \$\begingroup\$ Keg: . for 2-5 = -3 bytes... I also wish this was still open. \$\endgroup\$ – user85052 Sep 28 '19 at 1:07
  • 1
    \$\begingroup\$ 05AB1E, -3 bytes: •L \$\endgroup\$ – Makonede May 13 at 19:56
8
\$\begingroup\$

><>, 5 - 5 = 0 bytes

ab+n;

Well, that wasn't very hard. a and b in ><> are 10 and 11, respectively, so I just needed to add them together.

I imagine that many other languages (I have golf languages especially in mind) will have similar solutions.

\$\endgroup\$

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