-6
\$\begingroup\$

This question already has an answer here:

So, blatantly plagiarizing from inspired by this challenge and its sequel, I thought I'd add another.

The text to match:

What do you get when you multiply six by nine

The result your function/program/etc. should print or return:

42

An online calculator for Levenshtein distance can be found here: http://planetcalc.com/1721/

Comments are disallowed.

\$\endgroup\$

marked as duplicate by Alex A., Downgoat, Beta Decay, Peter Taylor, feersum Jul 24 '15 at 9:11

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\$ Personally, I don't find these challenges very interesting. Most of the time it's near-impossible to have any meaningful overlap with the text, leading to submissions which just leave the excess floating around. \$\endgroup\$ – Sp3000 Jul 24 '15 at 2:12
  • \$\begingroup\$ Fair enough. I haven't seen all that many of these myself, though - do they have a tag associated with them, or are they just that bad? \$\endgroup\$ – Stephen Voris Jul 24 '15 at 2:31
  • \$\begingroup\$ Voting to close as a duplicate of the linked challenge because, while not an exact duplicate, it isn't appreciably different. \$\endgroup\$ – Alex A. Jul 24 '15 at 3:29
  • 1
    \$\begingroup\$ This is much too similar, and in much too close succession. If you're going to steal a challenge, at least wait until it's long dead before posting it ;) \$\endgroup\$ – Beta Decay Jul 24 '15 at 5:31
7
\$\begingroup\$

GolfScript, 2

What 42 you get when you multiply six by nine

All words except do are undefined tokens, so they do nothing.

Try it online in Web GolfScript.

\$\endgroup\$
3
\$\begingroup\$

TI-BASIC, 3

Replaces the first character with length(, which is a single TI-BASIC token.

length("t do you get when you multiply six by nine
\$\endgroup\$
  • 1
    \$\begingroup\$ So you're allowed to count the length of your program after tokenisation? \$\endgroup\$ – Beta Decay Jul 24 '15 at 5:29
  • 1
    \$\begingroup\$ There is no "after tokenization" in TI-83 BASIC; the only way to enrer characters is as tokens. \$\endgroup\$ – lirtosiast Jul 24 '15 at 14:25
2
\$\begingroup\$

Ruby, 10

p"What do you get when you multiply six by nine".sum/99

In the spirit of the challenge. Following the letter I think the best you can do is

p 42||"What do you get when you multiply six by nine"

but that program would still work if you changed the string.

\$\endgroup\$
1
\$\begingroup\$

Pyth, 4

42 "What do you get when you multiply six by nine

That's not a comment, it's a string that doesn't get printed.

\$\endgroup\$
1
\$\begingroup\$

CJam, 3

"hat do you get when you multiply six by ni",

, pushes the string's length.

Try it online in the CJam interpreter.

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

CMD, 9

echo 42||What do you get when you multiply six by nine

Code after || inline will only run if the previous command generates an error.

\$\endgroup\$

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