-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\$
  • \$\begingroup\$ This is a tad too similar to the 2014 challenge. It's also quite trivial in a couple of languages. CJam could do this in two bytes with K) or YX. \$\endgroup\$ – Dennis Oct 3 '15 at 6:29
  • 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
  • \$\begingroup\$ @Dennis Thanks! I was not aware of that \$\endgroup\$ – Albert Renshaw Oct 3 '15 at 7:18
  • 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
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.

| improve this answer | |
\$\endgroup\$

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