-6
\$\begingroup\$

The challenge is as simple as it suggests, you have to print a string without using single/double quotes in source code.

The string is:

The quick brown fox jumps over the lazy dog
  • Standard loopholes apply

  • , shortest code wins

\$\endgroup\$
8
  • 5
    \$\begingroup\$ You should use the Sandbox first, challenge is way too trivial \$\endgroup\$ – Wasif Feb 19 at 4:00
  • 6
    \$\begingroup\$ Exactly which characters count as single/double quotes? Only the ASCII characters 0x27 and 0x22? (Some answers are using 0x201C (left double quotation mark) or 0x275D (heavy double turned comma quotation mark ornament).) \$\endgroup\$ – Dingus Feb 19 at 5:23
  • 6
    \$\begingroup\$ This would be an interesting challenge, if it hadn't been done a million times. I think Do X without Y can be interesting, but it usually isn't because there are only so many ways to do it creatively (and most have already been done). \$\endgroup\$ – Redwolf Programs Feb 19 at 5:27
  • 13
    \$\begingroup\$ Dear serial downvoter, please leave comments on the answers before downvoting them, so the answerer and future readers can improve the answer \$\endgroup\$ – Wasif Feb 19 at 8:18
  • 5
    \$\begingroup\$ @Wasif I haven't downvoted any of the answers here, but I strongly suspect that most of the downvotes cast match exactly the reason given when you hover over the downvote button: "this answer is not useful." The majority seem to be in languages that simply wouldn't use quotes anyway. You aren't ever owed an explanation - the voter chooses to explain if they believe the answer can be made better. Of course, I could be wrong and someone could be voting based on user - but if you think that is the case you should flag to contact a mod. \$\endgroup\$ – FryAmTheEggman Feb 19 at 21:58

36 Answers 36

1
2
0
\$\begingroup\$

Perl 5, 50 bytes

say q/The quick brown fox jumps over the lazy dog/

Try it online!

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

Python 2, 380 bytes

print chr(84)+chr(104)+chr(101)+chr(32)+chr(113)+chr(117)+chr(105)+chr(99)+chr(107)+chr(32)+chr(98)+chr(114)+chr(111)+chr(119)+chr(110)+chr(32)+chr(102)+chr(111)+chr(120)+chr(32)+chr(106)+chr(117)+chr(109)+chr(112)+chr(115)+chr(32)+chr(111)+chr(118)+chr(101)+chr(114)+chr(32)+chr(116)+chr(104)+chr(101)+chr(32)+chr(108)+chr(97)+chr(122)+chr(121)+chr(32)+chr(100)+chr(111)+chr(103)

Try it online!

Nothing special generated using

print(''.join("chr("+str(n)+")"+"+" for n in (84,104,101,32,113,117,105,99,107,32,98,114,111,119,110,32,102,111,120,32,106,117,109,112,115,32,111,118,101,114,32,116,104,101,32,108,97,122,121,32,100,111,103)))

Python 2, 342 325 bytes

o=chr(111);s=chr(32);print chr(84)+chr(104)+chr(101)+s+chr(113)+chr(117)+chr(105)+chr(99)+chr(107)+s+chr(98)+chr(114)+o+chr(119)+chr(110)+s+chr(102)+o+chr(120)+s+chr(106)+chr(117)+chr(109)+chr(112)+chr(115)+s+o+chr(118)+chr(101)+chr(114)+s+chr(116)+chr(104)+chr(101)+s+chr(108)+chr(97)+chr(122)+chr(121)+s+chr(100)+o+chr(103)

Try it online!

Saved a lot using avoid of repeated chr functions

Python 2, 173 bytes

s=32;o=111;print bytearray([84,104,101,s,113,117,105,99,107,s,98,114,o,119,110,s,102,o,120,s,106,117,109,112,115,s,o,118,101,114,s,116,104,101,s,108,97,122,121,s,100,o,103])

Try it online!

Credits to @ovs for the huge save

After that -5 bytes saved using the ^ trick

\$\endgroup\$
7
  • \$\begingroup\$ 178 bytes with bytearray. \$\endgroup\$ – ovs Feb 19 at 8:18
  • \$\begingroup\$ @ovs thank you, why haven't I see this function before \$\endgroup\$ – Wasif Feb 19 at 8:24
  • \$\begingroup\$ Well it's rarely actually useful (In my ~540 Python answers I've never used this) and the string representation of bytearray objects has changed in Python 3 which makes this even less useful. \$\endgroup\$ – ovs Feb 19 at 8:35
  • \$\begingroup\$ Without bytearray then best I could do was print `0`[:0].join(map(chr,[84,104,101,32,113,117,105,99,107,32,98,114,111,119,110,32,102,111,120,32,106,117,109,112,115,32,111,118,101,114,32,116,104,101,32,108,97,122,121,32,100,111,103])) (190 bytes). \$\endgroup\$ – Neil Feb 19 at 10:19
  • \$\begingroup\$ Make that 185 bytes: s=32;e=101;o=111;print `0`[:0].join(map(chr,[84,104,e,s,113,117,105,99,107,s,98,114,o,119,110,s,102,o,120,s,106,117,109,112,115,s,o,118,e,114,s,116,104,e,s,108,97,122,121,s,100,o,103])) \$\endgroup\$ – Neil Feb 19 at 10:22
0
\$\begingroup\$

Zsh, 47 bytes

<<a
The quick brown fox jumps over the lazy dog

Try it online!

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

05AB1E, 21 bytes

“TheŠ©ŽÌ¨›ïÅs‚Š€€äŸ‹·

Try it online.

NOTE: I assume (codepoint 8220) is allowed and only " (codepoint 34) and ' (codepoint 39) are disallowed. If this isn't the case (it means some other answers using backticks are invalid as well btw), I could use this as alternative (32 bytes):

.•?₁Î₃αej;ΩŠ¼Ÿ÷s*KÀòaΔ€§Ë¼éž•¦.ª

Try it online.

Explanation:

“TheŠ©ŽÌ¨›ïÅs‚Š€€äŸ‹·  # Push dictionary string "The quick brown fox jumps over the lazy dog"
                       # (after which it is output implicitly as result)


.•?₁Î₃αej;ΩŠ¼Ÿ÷s*KÀòaΔ€§Ë¼éž•
                       # Push compressed string "dthe quick brown fox jumps over the lazy dog"
  ¦                    # Remove the first character (the "d")
   .ª                  # Sentence capitalize it
                       # (after which it is output implicitly as result)

The leading d in the compressed string is to ensure the compressed string doesn't contain any kind of quotes itself, which is the case when we simply compress the lowercase sentence, or have a leading a, b, or c (Try it online).

See this 05AB1E tip of mine (section How to use the dictionary? and How to compress strings not part of the dictionary?) to understand how it works.

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

PHP, 186 bytes

<?=join(array_map(chr,[84,104,101,32,113,117,105,99,107,32,98,114,111,119,110,32,102,111,120,32,106,117,109,112,115,32,111,118,101,114,32,116,104,101,32,108,97,122,121,32,100,111,103]));

Try it online!

Just for fun, as there's a much shorter PHP answer already (which is basically a Text answer actually)

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

Bubblegum, 44

00000000: 0bc9 4855 282c cd4c ce56 482a ca2f cf53  ..HU(,.L.VH*./.S
00000010: 48cb af50 c82a cd2d 2856 c82f 4b2d 5228  H..P.*.-(V./K-R(
00000020: 014a e724 5655 2aa4 e4a7 0300            .J.$VU*.....

Try it online!

\$\endgroup\$
1
2

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