Take the 2-minute tour ×
Programming Puzzles & Code Golf Stack Exchange is a question and answer site for programming puzzle enthusiasts and code golfers. It's 100% free, no registration required.

In the spirit of Hello world! with NO repetition

Write a program that prints the string "the quick brown fox jumps over the lazy dog" with optional newline. The entire program must not repeat any characters.

Note that the string to be printed does repeat characters, so you will have to get around that limitation somehow.

Note that the winning condition is , i.e. the highest-voted answer wins.

Update: To make this a little easier, repetition is allowed but you must attempt to minimize it. Programs with less (or no) repetition are given precedence over programs with some repetition.

share|improve this question
I'm afraid this is probably too hard, if not outright impossible. Hello world! without repetitions was hard enough that people had to resort to very niche languages or outright couldn't solve the task completely at all, and this one is considerably harder on top of that. –  FireFly Jan 23 '14 at 17:29
Well, it sure is impossible in C. You can't call functions or use macros. –  Oberon Jan 23 '14 at 17:50
I recommend: print the given string with as few repeated characters as possible. –  primo Jan 23 '14 at 18:18
@FireFly didn't take long to have answers :) –  SirDarius Jan 23 '14 at 19:10
@tmartin No, it isn't. The linked question favours repetition while the present question penalises it. –  gerrit Jan 24 '14 at 12:05

7 Answers 7

Microsoft Word from 97 to 2003 (and some Mac Word versions) — 10 characters

No repetitions, but doesn't quite match specs - 10 characters:



The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.

Matches specs, other than capitalization and punctuation, one repetition - 10 characters:



The quick brown fox jumps over the lazy dog.

Newer versions of Microsoft Word use =rand.old(1,1) which duplicates d and 1.

There might be a way to use a field {=SUM(3,-2)} as input to rand() but my installation is having issues with fields -- namely, they're not working...

"Bob" has confirmed that {=SUM(3,-2)} (with some difficulty) can be used to replace the first 1, but = is repeated...


Provided you get Word to update SUM first, the output is:

The quick brown fox jumps over the lazy dog.
share|improve this answer
I'm not sure the given syntax is right, but I don't have any systems that old to test it on. For newer versions though, it should be =rand.old(1,1). I suppose you're trying to use 3-2 to replace the first 1, but it doesn't appear to be working for me in 2010 with rand.old or rand. –  Iszi Jan 23 '14 at 19:02
I don't have a system here either, will check when I get home. Might need to use braces { ... } as delimiters, but I'm pretty sure expressions can be used in any function. If not, I'll revise! –  Yimin Rong Jan 23 '14 at 19:14
I can confirm the {=SUM(3,-2)} works in Word 2007. But the method is a bit complicated. First, you must insert a field code (Ctrl + F9). Then, right click => edit field => formula => advanced => type in the formula. Because typing it in directly doesn't work for whatever reason. Now click in the field and evaluate with Shift + F9. And add the =rand.old() –  Bob Jan 24 '14 at 4:45
Is it necessary to use =SUM, or could simply use arithmetic operators directly, as 3-2? –  supercat Jan 24 '14 at 15:44
@supercat - We tried that, and for some reason, Word does not accept expressions as parameters of =rand(), e.g. =rand(3-2,1) would be perfect. I actually didn't try =rand({=3-2},1), but it should work the same way, with duplication of =. –  Yimin Rong Jan 24 '14 at 16:03

Sclipting — 36 characters


(expects empty input)


Push the string "the quick brown ,fo,x, jumps ove,r the lazy dog,"
Retrieve last character from the string (",")
Regular expression string-split

The result is the list ["the quick brown ", "fo", "x", " jumps ove", "r the lazy dog", ""], which is automatically concatenated into a single string for output.

share|improve this answer
I count 105 bytes, not to mention several repeats. Char 235, for example, is used 20 times. –  primo Jan 23 '14 at 21:52
"Must not repeat any characters", not "must not repeat any bytes". –  Plutor Jan 23 '14 at 22:51
I'm not surprised Timwi, your own language is perfect for "no repeated characters" challenges. –  Pierre Arlaud Jan 24 '14 at 10:40

Perl 6 (76 chars, no doubles)

The script (will be mangled by the board software, but there's En Space up to Thin Space and NL and LF and tab)

say EVAL    lc q{<the Quiţk Brown fïX jUmpS ůvťɲ Tɨå ìšzY dOg>~&(127.CHR
  • It uses EVAL (thanks again for making it uppercase) and <foo bar> quote words which supports all the special space characters as word separators.
  • say joins the list of strings using space, works nicely here :)
  • Next I use ~& and 127 to bit shuffle to plain ascii. Extra complication: 'Ŭ'.lc becomes 'ŭ' so that becomes an s instead of the r I needed. Adding 128 some extra times helps :)

A version with backslash escapes instead of unicode characters to show they're all different

say\x[3000]EVAL\x[9]lc q{<the\x[2003]Qui\x[163]k\x[2004]Brown\x[2005]f\x[EF]X\x[2006]jUmpS\x[2007]\x[16F]v\x[165]\x[272]\x[2008]T\x[268]\x[E5]\x[2009]\x[EC]\x[161]zY\x[200A]dOg>~&(127.CHR\x[0A]x\x[0D]43)}

If you want to verify they're all unique, use this script (I used Qb"string" to have basic quoting with only backslash escapes)

.say for 
Qb"say\x[3000]EVAL\x[9]lc q{<the\x[2003]Qui\x[163]k\x[2004]Brown\x[2005]f\x[EF]X\x[2006]jUmpS\x[2007]\x[16F]v\x[165]\x[272]\x[2008]T\x[268]\x[E5]\x[2009]\x[EC]\x[161]zY\x[200A]dOg>~&(127.CHR\x[0A]x\x[0D]43)}"
.comb.Bag.grep(*.value > 1).map: {.key.ord.base(16) ~ " $_"  }

Or execute it directly using

EVAL Qb"say\x[3000]EVAL\x[9]lc q{<the\x[2003]Qui\x[163]k\x[2004]Brown\x[2005]f\x[EF]X\x[2006]jUmpS\x[2007]\x[16F]v\x[165]\x[272]\x[2008]T\x[268]\x[E5]\x[2009]\x[EC]\x[161]zY\x[200A]dOg>~&(127.CHR\x[0A]x\x[0D]43)}"
share|improve this answer

PHP - 67 bytes


Copy-Paste, save as Latin-1 (Ansi).

This is a 7-byte xor-cipher, using the string ¶¥€¼½ˆ• for salt.

One repeated character: $.

share|improve this answer
You can shorten it another 3 character by using <?= since you are already using short tags –  Kristoffer S Hansen Jan 24 '14 at 10:40
Ah, sorry, just noticed you already use = –  Kristoffer S Hansen Jan 24 '14 at 10:41
@KristofferSHansen I think it should be possible to use eval('Return$g=binary;') in some cryptic form (perhaps bit inversion) to avoid the $ repetition, and then the = would be freed up as well. –  primo Jan 24 '14 at 10:48
The opening tag should not be included in the byte count. –  TecBrat Jan 24 '14 at 14:04
@TecBrat The final ; can be replaced by closing tag: should that not be counted either? In short, I disagree. If your code doesn't run as-is, it's not a complete program. –  primo Jan 24 '14 at 14:14

Haskell, 71 characters

map(\c->chr$mod(ord c)128)"tŨeఠquiţkĠbŲɯwnȠfѯxРjѵŭŰsܠůvťѲठѴѨѥਠlšzyଠɤկg"

Yet another 7-bit modulo solution.

Repeated characters:

c 3
d 2
m 2
o 2
r 2
( 2
) 2
" 2

First time golfing with Haskell; anyone more experienced in the language, feel free to improve. I wanted to make the anonymous function point-free to avoid having to mention a variable twice, but I don't know if it'd be a net benefit.

share|improve this answer

JS, 35


(yeah... the double quote is repeated. and the output is bad. It's not a serious answer yet.)

share|improve this answer

Batch Script: 7 bytes

echo %1

If the script is named hello.bat, type this in at the command line:

hello.bat "The quick brown fox jumps over the lazy dog"
share|improve this answer
This is, this is so... case insensitive! (I mean, it doesn't print exactly what the question asks for.) –  Mr Lister Jan 24 '14 at 11:10
By typing that in at the command line, you are repeating characters. –  gerrit Jan 24 '14 at 11:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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