text:
Right-align text
Your job is to take a string input and a number and align the string to the right, making the width of the text the number. When a line is too long, break it and put the rest on the next line, repeating until it's not necessary. If a line is shorter than the width, then pad it with spaces. Multiple newlines can occur, and should be treated like any other single character.
For example, the string
Programming
Puzzles
&
Code
Golf

and the number 5 would produce:
Progr
ammin
    g
Puzzl
   es
    &
 Code
 Golf

Whereas the same string and the number 10 would produce:
Programmin
         g
   Puzzles
         &
      Code
      Golf

The string
a

b

and the number 5 would produce:
    a
      <-- note the 5 spaces
    b

Shortest code wins!

The text says “Break the lines when necessary [...]”, but your examples suggest that you break after every word, even when it would fit. Please clarify: do we place each word on a new line, or do we implement an actual word-wrapping algorithm?

Can there be spaces in the middle of an input line, e.g. Programming Puzzles\n&\nCode Golf?

@sp3000 There can be any character, including spaces.

@Timwi: The example has one word per line.  It would have been better to include some multi-word lines to make it clear that space within a line isn't special.  (i.e. there are only newlines, and non-newlines.)

Do 5 char take 1 or 2 lines?

Pyth, 14 bytes
jm.[\ QdscRQ.z

Demonstration
Uses Pyth's pad operator.

Python 2, 84
s,n=input()
for w in s.split('\n'):
 w=w or' '
 while w:print w[:n].rjust(n);w=w[n:]

Takes as input a string with newlines and a number, and prints the result. For each line in the input, takes and prints n chars at a time, using the built-in rjust to pad the left with spaces before printing.
I fixed the empty line case with the hack w=w or' '. There's probably a better method but I'm not going to think much about it.

CJam, 21 bytes
li_qN/Sfe|f/ff{\Se[N}

Thanks to @Sp3000 for golfing off 1 byte and paving the way for 3 more.
Try it online in the CJam interpreter.
How it works
li                     Read an integer L from the first line of input.
  _                    Push a copy.
   qN/                 Split the remaining input at linefeeds.
      Sfe|             Map `OR " "'; the replaces empty lines with a space.
          f/           Split each line into chunks of length L.
            ff{     }  For each chunk, push L and the chunk; then:
               \         Swap L with the chunk.
                Se[      Left-pad the chunk to length L by prepending " ".
                   N     Push a linefeed.

Pyth, 16
jm>Q+*\ QdscRQ.z

Try it online here
Explanation
jm>Q+*\ QdscRQ.z             : Q is the number on the first line, .z takes the rest
           cRQ.z             : chop each line of .z into chunks of Q characters
 m        s                  : remove nested lists and map over the result
    +*\ Qd                   : add Q spaces to each line d
  >Q                         : take the last Q characters of that result
j                            : join results on newlines

Perl, 39 bytes
perl -ni5 -e 's!^$|.{1,$^I}!printf"%${^I}s
",$&!ge'

36 bytes + 3 bytes for -ni. The wrap width is passed as the argument to -i.
Handles blank lines properly by padding them with spaces:
$ echo -e "Programming\nPuzzles\n\n&\n\nCode\nGolf" | perl -ni5 -e 's!^$|.{1,$^I}!printf"%${^I}s
",$&!ge'
Progr
ammin
    g
Puzzl
   es

    &

 Code
 Golf

How it works
This solution uses the substitution operator to loop through the input, saving a byte over the equivalent for loop. The real trick, though, is in the regex on the LHS of the substitution:
^$|.{1,$^I}

With the global modifier, this will match $^I characters at a time; when there are less than $^I characters remaining in the string, it will match everything to the end. The alternation with ^$ is required to handle blank lines. For example:
$ echo -e "foo\n\nbar" | perl -ni2 -E 'say "<$_>" for /^$|.{1,$^I}/g'
<fo>
<o>
<>
<ba>
<r>

The RHS of the substitution simply uses printf to left-pad the matched chunk with spaces.

I always forget about $^I!

@DomHastings I learned that trick from chilemagic, who mentioned it in a comment on another challenge.

Javascript (ES6), 107
I wish JS had a built in pad function. Oh well.
(a,b)=>a.replace(eval(`/(.{${b}})(?!\\n)/g`),`$1
`).split`
`.map(c=>(Array(b).join` `+c).slice(-b)).join`
`

Explanation:
(a, b)=>

  // searches for sequences of characters longer than b without a newline after them and
  // adds a newline after every b characters of the sequence
  a.replace(eval(`/(.{${b}})(?!\\n)/g`), '$1\n')
    .split('\n')
    .map(c=>

      // prepends b spaces to each string then slices it from the right down to length b
      ( Array(b).join(' ') + c ).slice(-b)

    ).join('\n')

Julia, 126 bytes
f(s,n)=for i=split(s,"\n") while length(i)>0 println(lpad(i[1:min(n,end)],n));length(i)<n?break:(i=i[min(n+1,end):end])end;end

Ungolfed:
function f(s::String, n::Int)
    for i in split(s, "\n")
        while length(i) > 0
            println(lpad(i[1:min(n,end)], n))
            length(i) < n ? break : (i = i[min(n+1,end):end])
        end
    end
end

Bash, 62, 61+feature, 59
Shorter if N can be set by the caller, instead of having to read it as the first line of input.
# width as a function arg: 59 chars
f()while read -rn$1 r;do [[ $r ]]&&printf %$1s\\n "$r";done
# width on stdin: 64 chars  (not updated with later suggestions&ideas)
read N;while read -rn$N r;do [[ $r ]]&&printf %$N's\n' "$r";done

This fails to handle empty lines in the input.  Otherwise, this doesn't subject the input data to word-splitting, pathname expansion, or otherwise treat it as more than just raw data.
read -n$N saves one character, but lets read munge \.
The [[ $r ]]&& is needed because read -n4 can't lookahead to see that the next char is a newline.  So it sets r to a 4-char string, and the next read produces a zero-char empty string.  Filtering these false newlines without filtering real newlines would require tracking state: whether the previous line was max-length or not.  Either more code or a totally different approach would be needed.
[[ $r ]] is shorter than [ -n "$r" ] which is needed to avoid errors if the line starts with -z foo, or is * or something, if you used [ $r ].
Justication happens with the standard printf "%4s" format string.
Test with
f()(while read -rn$1 r;do [[ $r ]]&&printf %$1s\\n "$r";done); (echo 4; echo -e "*\n\\"; cat /tmp/lines) | f 4

I'd include -r in the byte count. 2. f()(while ... done) is a bit shorter.

@Dennis: Without [[ $r ]]&&, if N=4, an input line of length 4 will produce a blank output line where there wasn't one before.  Because read returns a string of 4 chars, then sees a newline on the next call and returns right away.  Also, thanks for the () tip.  I didn't know you could define fns that way.

I recommend reading Tips for golfing in Bash. It's a great resource.

Actually, since while is already compound, you don't even need the parentheses: f()while ... done

@Dennis: wow, haxx.  Thanks for the link.  A couple of those things were new to me, and I fixed a couple things in another answer :)  I don't normally golf, but >15 years of being a command-line junkie has taught me a thing or two :)

Haskell, 108 bytes
import Data.List.Split
k[]=[""]
k x=x
f n=unlines.(map(\l->([1..n-length l]>>" ")++l).k.chunksOf n=<<).lines

Usage example:
*Main> putStr $ f 5 "a\n\nb\ncd\nMatamorphosis"
    a

    b
   cd
Matam
orpho
  sis

How it works
                              .lines   -- split input string at newlines
                           =<<         -- for every line
                  chunksOf n           --    split into chunks of length n
                k                      --    fix empty lines
    map                                --    for every chunk
        \l->([1..n-length l]>>" "      --      make a string of missing spaces
                        ++l            --      and append the chunk
unlines                                -- join padded chunks with newlines in-between

GNU awk + bash, 70
f()(awk -vFPAT=.\{,$1} '{for(i=0;i++<NF;){printf "%'$1's\n",$i}}/^$/')

Using bash to slot the count into the awk program is prob. smaller than reading it with a NR==1{N=$0} block.
Read a line at a time.  Split into at-most-4 character chunks, using FPAT.  (matches the fields, rather than the separators. GNU extension.)  printf each field separately.  (Default ORS = \n).
The /^$/ rule is there to print empty lines, which have NF=0 and thus don't print at all in the other block.  So unlike my pure-bash solution, this actually works in the general case.
Semi-unrelated, but my idea so far for perl is 112 chars for just the perl code:
(echo 4; echo -e 'foo\nbar'; echo -e "*\n\\"; echo '~$(true)'; cat /tmp/lines) |  # test input
perl -e '$N=<>;$/=\1;print "$N\n"; while(<>){if(/\n/ or length($l)>=$N){printf("%$4s\n",$l);$l=/\n/?"":$_;}else{$l.=$_;}}'

This eats one of the newlines, and is way too long.  $/=\1 reads a byte at a time.  We append to $l.  Probably a line-at-a-time with fixed-width split approach would be shorter.

Bash + GNU utils, 41
fold -$1|sed ":;s/^.\{,$[$1-1]\}\$/ &/;t"

String is input via STDIN, width is input by command-line arg:
ubuntu@ubuntu:~$ echo 'Programming
Puzzles
&
Code
Golf'|./ralign.sh 10
Programmin
         g
   Puzzles
         &
      Code
      Golf
ubuntu@ubuntu:~$

Python 2, 151 bytes
s,n=input();N='\n'
for w in[i.lstrip()if i.replace(' ','').isalpha()else i for i in s.replace(N,'\n ').split(N)]:
 while w:print w[:n].rjust(n);w=w[n:]

This is a adaptation of @xnor's answer above, as his does not properly handle newlines.

The for loop was changed from:
for w in s.split('\n'):

to:
for w in[i.lstrip()if i.replace(' ','').isalpha()else i for i in s.replace(N,'\n ').split(N)]:

Example
$ python main.py
"Programming\n\n\nPuzzles\n\n&\n\nCode\nGolf", 5
Progr
ammin
    g

Puzzl
   es

    &

 Code
 Golf

C#, 143 bytes
(s,n)=>Join("\n",s.Split('\n').SelectMany(l=>(l.Any()?l:" ").Select((c,i)=>new{c,i}).GroupBy(o=>o.i/n,o=>o.c).Select(g=>Concat(g).PadLeft(n))))

Linq lets you make pretty gnarly expressions. GroupBy is useful here, but it's a shame they couldn't create function overloads taking the index.
Assign the lambda to a Func<string, int, string> to run it
Less golfed:
Func<string, int, string> Align = (s, n) => Join("\n",
    s.Split('\n')
     .SelectMany(l => (l.Any() ? l : " ")
         .Select((c, i) => new { c, i })
         .GroupBy(o => o.i / n, o => o.c)
         .Select(g => Concat(g).PadLeft(n))));

Burlesque, 28 Bytes
Same as the version below, but treats line 1 as the number and
the other lines as the string.
lng_riPpun{pPco{pP' lp}mu}Wl

Usage as in:
$ cat input.txt | blsq --stdin "lng_riPpun{pPco{pP' lp}mu}Wl"
Progr
ammin
    g
Puzzl
   es
    &
 Code
 Golf

Old Version (16 bytes):
{5co{5' lp}mu}Wl

Example:
blsq ) "Programming\nPuzzles\n&\nCode\nGolf"{5co{5' lp}mu}Wl
Progr
ammin
    g
Puzzl
   es
    &
 Code
 Golf

Groovy, 63 bytes
Returns the correctly alligned string. Didn't know there was a padLeft (and padRight, padCenter) function until now.
f={s,n->s.split("(?<=\\G.{$n})|\n")*.padLeft(n," ").join("\n")}

JavaScript 174 136
function R(s,x){return s.replace(new RegExp(".{"+x+"}","g"),"$&\n").replace(/[^\n]*/g,function(m){
while(m.length<x)m=" "+m;return m;})}

Ceylon, 107
String w(String s,Integer n)=>"\n".join{for(l in s.lines)for(p in l.partition(n))String(p).padLeading(n)};

Matlab, 99 bytes
Thanks to @beaker for removing 6 bytes!
Using and anonymous function:
@(s,k)fliplr(char(cellfun(@fliplr,strsplit(regexprep(s,sprintf('\\S{%i}',k),'$0\n'),'\n'),'un',0)))

Define the function and use ans to call it:
>> @(s,k)fliplr(char(cellfun(@fliplr,strsplit(regexprep(s,sprintf('\\S{%i}',k),'$0\n'),'\n'),'un',0)))

ans =

@(s,k)fliplr(char(cellfun(@fliplr,strsplit(regexprep(s,sprintf('\\S{%i}',k),'$0\n'),'\n'),'un',0)))

>> ans(['Programming' 10 'Puzzles' 10 '&' 10 'Code' 10 'Golf'], 5) %% 10 is line feed

ans =

Progr
ammin
    g
Puzzl
   es
    &
 Code
 Golf


text:
Just repeat yourself
Write a program that outputs
Do not repeat yourself!

Your program code must respect the following constraints :

its length must be an even number
each character that is in position 2n (where n is an integer > 0) must be equal to the character in position 2n-1. The second character of the program is equal to the first, the fourth is equal to the third, etc.

Newlines count as characters!
This is code-golf, so the shortest code wins!
Examples
HHeellllooWWoorrlldd is a valid program
123 or AAABBB or HHeello are incorrect
Verification
You can use this CJam script to verify that your source code is valid. Simply paste your code into the "Input" box and run the script.

Fun fact: If the problem had triplets instead, DDDooo   nnnooottt   rrreeepppeeeaaattt   yyyooouuurrrssseeelllfff!!! would be a valid answer in Trigger

I thought this might be too restrictive, but the flurry of answers proves me wrong. Nice question!

It would take a pretty serious stretch to satisfy these requirements in Haskell. All binding forms, all forms of conditional expression, all ways to enter characters and strings, and all ways to produce output are eliminated.

Could someone add a scoring snippet? I like having those, and I wish every question had them.

All the current answers are esoteric langs. I wonder if this is possible in a normal lang?

@trichoplax Too restrictive for: Python, ///, 0815, C, possibly others too...

Anyone have an idea on how to get any other string other than '', "" or `` in JavaScript with this methodology? I'm still working on this...

@Trigger Along a similar vein, if the rule was to repeat words, not letters, then Chicken could be the go-to language.

Hexagony, 166 126 124 bytes
\\;;;;33rr''22DD..));;;;;;oo;;}}eeoo\\@@nn;;;;ee;;;;aass&&;;uuoo;;;;..\\\\;;ttee..pp;;tt;;;;..rr;;''ll..'';;;;..;;}}ff..}}yy

Inserting the implicit no-ops and whitespace, this corresponds to the following source code:
       \ \ ; ; ; ; 3
      3 r r ' ' 2 2 D
     D . . ) ) ; ; ; ;
    ; ; o o ; ; } } e e
   o o \ \ @ @ n n ; ; ;
  ; e e ; ; ; ; a a s s &
 & ; ; u u o o ; ; ; ; . .
  \ \ \ \ ; ; t t e e . .
   p p ; ; t t ; ; ; ; .
    . r r ; ; ' ' l l .
     . ' ' ; ; ; ; . .
      ; ; } } f f . .
       } } y y . . .

I'm sure it's possible to shorten this even more, and maybe even solve it in side-length 6, but it's getting tricky...
How it works

Diagram generated with Timwi's Hexagony Colorer.
The code is completely linear. The \ right at the start redirects the IP into a diagonal, such that we don't need to worry about the doubled characters at all. The coloured paths are executed in the order orange/red, blue/grey, green, purple (when there are two paths of the same colour, the left-hand path is executed first, before wrapping around to the right-hand one).
If we ignore no-ops, mirrors and commands which are overridden by others, the linear code comes down to this:
D;o;&32;}n;o;t;';}r;e;p;e;a;t;';}y;o;u;r;s;e;l;f;');@

Letters in Hexagony just set the current memory edge's value to the letter's character code. ; prints the current memory edge as a character. We use & to reset the memory edge to 0 and print a space with 32;. } moves to a different edge, so that we can remember the 32 for further spaces. The rest of the code just prints letters on the new edge, and occasionally moves back and forth with ';} to print a space. At the end we move to the space edge again with ', increment the value to 33 with ) and print the exclamation mark. @ terminates the program.

This is really impressive!!!

How did you reach the conclusion that it’s possible in size 6 or even 5? I see size 7 as even only barely fitting.

@Timwi 5 was probably a bit overambitious, but with the exception of a single ;, there is absolutely no reuse between character pairs in the code yet. The current code is pretty much the first thing that came to my mind, so I'm thinking if one tried hard enough, it should be possible to find a much more complicated solution which reuses the semicolons and maybe even some letters, to fit this into side length 6.

To get to size 6, you’d have to save 36 characters compared to size 7. Even if you use the 6 unused slots you have at the moment, you’d still have to save 30. You can reuse every ; only once because you cannot traverse them horizontally. There are only 23 ;s in your code, and only 6 character repetitions (2×o, 1×t, 1×r, 2×e), giving only 29. Personally, this more than convinces me that size 6 is impossible...

GolfScript, 130 84 76 bytes
22..!!..00)){{DDoo  nnoott  rreeppeeaatt  yyoouurrsseellff}}``%%>><<[[33]]++

Try it online in Web GolfScript.
How it works
The GolfScript interpreter starts by placing an empty string on the stack.
22 # Push 22.
.. # Push two copies.
!! # Negate the last copy twice. Pushes 1.
.. # Push two copies.
00 # Push 0.
)) # Increment twice. Pushes 2.

   # STACK: "" 22 22 1 1 1 2

{{DDoo  nnoott  rreeppeeaatt  yyoouurrsseellff}}

`` # Push a string representation of the string representation of the block.

   # This pushes "{{DDoo  nnoott  rreeppeeaatt  yyoouurrsseellff}}" (with quotes).

%% # Take every second element of that string, then every element of the result.
>> # Discard the first element of the result. Repeat.
<< # Truncate the result to length 22. Repeat.
[[ # Begin a two-dimensional array.
33 # Push 33, the character code of '!'.
]] # End the two-dimensional array.
++ # Concatenate the empty string, the 22-character string and the array [[33]].

Concatenating an array with a string flattens, so the result is the desired output.

Unary, ~1.86 × 10222
Simple brainfuck -> unary answer. Very sub-optimal ;).
The program consists of an even number of 0’s; specifically:

1859184544332157890058930014286871430407663071311497107104094967305277041316183368068453689248902193437218996388375178680482526116349347828767066983174362041491257725282304432256118059236484741485455046352611468332836658716

of them.
Original brainfuck code:
++++[++++>---<]>+.[--->+<]>+++.[--->+<]>-----.+[----->+<]>+.+.+++++.[---->+<]>+++.---[----->++<]>.-------------.+++++++++++.-----------.----.--[--->+<]>-.[---->+<]>+++.--[->++++<]>+.----------.++++++.---.+.++++[->+++<]>.+++++++.------.[--->+<]>-.

Neither of the code blocks you've provided satisfy the double-up rule. What am I missing?

@doppelgreener: The first block of "code" is simply a large number. Specifically, the number of 1s in the Unary program that outputs the requested string. The second code block is the BF program that was used to produce it. As the Unary program is completely made of 1s, it trivially satisfies the repetition requirement.

Also the number of zeroes is (luckily?) an even number :-)

I’ve taken the liberty to edit the answer so that the number doesn’t look like it’s supposed to be the code.

Technically it's Golunar and not Unary ;)

@Kametrixom it is a Golunar description of the Unary program. The Golunar program as written doesn't fulfill the conditions.

Mmmh... is this a valid answer? For this type of challenges, shouldn't the code proposed in a solution be testable? Isn't it a loophole to provide a theoretical solution knowing well that the actual implementation is impossible?

@drolex answers that are impossible to run are completely fine as long as you can show why they would work unless specified by the OP

Ruby - 2100 1428 1032 820 670 bytes
This assumes the output can be a return value from a function (it wasn't specified that the output needs to be to STDOUT)
Code:
((((((((((((((((((((((((((((((((((((((((((((((""<<66++11**00++11**00))<<99++11++11**00))<<((55>>11**00))++((11>>11**00))))<<99++11))<<99++11++11**00))<<99++((33>>11**00))++11**00))<<((55>>11**00))++((11>>11**00))))<<99++11++((11**00<<11**00<<11**00))))<<99++11**00++11**00))<<99++11++11**00++11**00))<<99++11**00++11**00))<<88++((11>>11**00))++((11**00<<11**00<<11**00))))<<99++((33>>11**00))++11**00))<<((55>>11**00))++((11>>11**00))))<<99++22))<<99++11++11**00))<<99++((33>>11**00))++11**00++11**00))<<99++11++((11**00<<11**00<<11**00))))<<99++((33>>11**00))))<<99++11**00++11**00))<<99++((11>>11**00))++((11**00<<11**00<<11**00))))<<99++11**00++11**00++11**00))<<33))

The trick is to build the string from an empty string "" using the append operation << and the ASCII codes of the characters.
To get the numbers for the ASCII codes I'm trying to decompose the number into values I can easily generate. For example ASCII 90 is just 88+1+1, which is:

88 is okay on it's own
11**00 is 11^0, which is simply 1

Fortunately both ++ and -- would mean add in ruby, so I can write 90 as 88++11**00++11**00
There are some tricks to get to some numbers easier than just adding 1s, here is the code I'm using to generate the above (which includes all mappings I'm using):
d = "Do not repeat yourself!"

d.each_char do |c|
  print "(("
end

print '""'

VALUES = [
  [0,'00'],
  [1,'11**00'],
  [4,'((11**00<<11**00<<11**00))'],
  [5,'((11>>11**00))'],
  [11,'11'],
  [16,'((33>>11**00))'],
  [22,'22'],
  [27,'((55>>11**00))'],
  [33,'33'],
  [38,'((77>>11**00))'],
  [44,'44'],
  [49,'((99>>11**00))'],
  [55,'55'],
  [66,'66'],
  [77,'77'],
  [88,'88'],
  [99,'99']
].reverse

d.each_char do |c|
  print "<<"
  num = c.ord
  while num != 0
    convert = VALUES.find{|val|val.first<=num}
    print convert.last
    num -= convert.first
    print "++" unless num == 0
  end
  print "))"
end

I'm still thinking about other tricks to decrease the characters required to get to a number.
Note that if you use the -rpp flag, and add pp to the start of the code like so:
pp((((((((((((((((((((((((((((((((((((((((((((((""<<66++11**00++11**00))<<99++11++11**00))<<((55>>11**00))++((11>>11**00))))<<99++11))<<99++11++11**00))<<99++((33>>11**00))++11**00))<<((55>>11**00))++((11>>11**00))))<<99++11++((11**00<<11**00<<11**00))))<<99++11**00++11**00))<<99++11++11**00++11**00))<<99++11**00++11**00))<<88++((11>>11**00))++((11**00<<11**00<<11**00))))<<99++((33>>11**00))++11**00))<<((55>>11**00))++((11>>11**00))))<<99++22))<<99++11++11**00))<<99++((33>>11**00))++11**00++11**00))<<99++11++((11**00<<11**00<<11**00))))<<99++((33>>11**00))))<<99++11**00++11**00))<<99++((11>>11**00))++((11**00<<11**00<<11**00))))<<99++11**00++11**00++11**00))<<33))

then for extra 2+4 bytes this can function as a fully complete program, but it will print an extra " before and after the required string:
Example:
$ ruby -rpp golf.rb
"Do not repeat yourself!"

Could you clarify why this is not fully compliant? It looks perfect to me, and even the pp gem is a double letter...

@trichoplax: it's in the post: 1. additional " characters in output and 2. the need of the -rpp flag (which is not like --rrpp)

This answer is cool but answers that do not meet the specifications are subject to deletion.

@WheatWizard if you think it's more worth to delete this answer than to keep it, feel free to flag it for deletion

@SztupY To be absolutely clear, it is site policy to delete responses that do not follow the rules of the challenge.

@MikeBufardeci which were enacted months after this answer was posted

The consensus is that this deletion policy should apply to answers that predate it.

@MikeBufardeci as far as I know there is also the consensus about "output can be a function return" which the solution can satisfy without breaking any rules

@SztupY While there is a list of default I/O methods, they are just defaults. If a challenge specifies what the I/O methods need to be then you need to follow the challenge rules.

@MikeBufardeci this one didn't specify STDOUT, just that it has to be outputted, so I still don't see where the submission fails

Let us continue this discussion in chat.

><>, 174 bytes
vv

77

99

**

00

77

bb

**

pp

""

!!

ff

ll

ee

ss

rr

uu

oo

yy

tt

aa

ee

pp

ee

rr

tt

oo

nn

oo

DD

""

~~

oo

ll

11

==

;;

00

66

bb

**

..

Thankfully, in a sense the restriction doesn't apply vertically. However, the biggest problem is that we need to double every newline.
The code that runs roughly goes like this:
v            Redirect instruction pointer to move downwards
79*07b*p     Place a ? on row 77 before the first ;
"..."        Push "Do not repeat yourself!" backwards, riffled between spaces

[main loop]
~o           Pop a space and output a char
l1=?;        If there is only the final space left, halt
06b*.        Jump back to the start of the loop

Note that the program has no double spaces — when in string mode, ><> pushes spaces for empty cells. Conversely, however, this means that a solution using g (read single cell from source code) would be trickier, since what spaces are in the program become NULs when read.
(Note: This can be 50 bytes shorter if it terminates with an error, but I like it this way.)

The right tool for the job...

Sclipting, 186 146 bytes

끄끄닶닶긂긂닦닦닶닶덇덇긂긂댧댧뉖뉖댇댇뉖뉖눖눖덇덇긂긂뎗뎗닶닶덗덗댧댧댷댷뉖뉖닆닆뉦뉦긒긒
껢껢鎵鎵❶❶合合虛虛替替標標現現併併一一終終

To be clear, there are three lines of code, the middle of which is empty, because the newline needs to be duplicated. The byte count is based on UTF-16 encoding.
Explanation
The block of Korean characters at the start pushes the string "DDDof� \"\u0002nf�of�twG \"\u0002rw'efVpw\aefVaf\u0016twG \"\u0002yw�of�uwWrw'sw7efVlf�fff!\"\u0012". You will notice that every third character is a character we want; the rest is gibberish. Here’s why:
In Sclipting, two Korean characters encode three bytes. Thus, each Korean character effectively encodes 12 bits. To get a string starting with D, the first 8 bits have to be 0x44; the rest don’t matter, but since we have to repeat every character, the 12th to 20th bits are also going to be 0x44. Thus, we will have a value of the form 0x44n44n for some n, which decomposes into the three bytes 0x44 0xn4 0x4n.
For the o, which is 0x6F, we get the bytes 0x6F 0xn6 0xFn.
Since I’m lazy, I started by encoding "DDDooo   nnnooottt (etc.)" and then replaced every other character with the previous, which is why I get 0x444444 = "DDD" for the D and 0x6F66F6 = "of�" for the o. The � is there because 0xF6 by itself is invalid UTF-8 encoding.
Now, back to the program. The rest of the program proceeds as follows:

껢껢 — pushes the string ".\"�"
鎵鎵 — removes the last character twice, leaving us with "."
❶❶ — two duplicates. Stack now: [".", ".", "."]
合合 — concatenate twice. Stack now: ["..."]

Now, what I want to do next is use "..." as a regular expression so that I can match three characters from the original string at a time, using the 替...終 loop construct. However, since every instruction is duplicated, I need to have two such regular-expression loops nested inside each other, and if the stack underruns I get a runtime error. Therefore,

虛虛 — push the empty string twice

and then start the loops. This way, the outer loop iterates only once because it matches the regular expression "" against the string "", which yields a single match. The inner loop runs once for every match of "..." against the big string. The body of the loop is:

標標 — push two marks onto the stack. Stack now: [mark mark]
現現 — push two copies of the current regex match. Stack now: [mark mark "DDD" "DDD"]
併併 — concatenate up to the first mark. Stack now: ["DDDDDD"]
一一 — take first character of that string, and then (redundantly) the first character of that. Stack now has the character we want.

The inner loop ends here, so every match of the regular expression is replaced with the first character of that match. This leaves the desired string on the stack.
Then the outer loop ends, at which point the desired string is taken off the stack and the only match of "" in the string "" is replaced with it, leaving the desired string once again on the stack.

Umm... why didn't you use code format here? Is it the chinese characters?

@EriktheOutgolfer I was wondering the same thing (and they are Korean characters, not Chinese).

@KevinCruijssen I think there are some Chinese characters in there too. In fact, spec says that it uses Hangul for data and Chinese for instructions.

@EriktheOutgolfer Ah, you're indeed right. I should have rtfm.. :)

Labyrinth, 528 bytes
66))__vv          ..33::00&&__vv          ..44__99||__vv          ..33::00&&__vv            ..99))__vv            ..99))__vv      ..44__88$$__vv          ..22__99++__vv          ..22__99$$__vv            ..22__99))$$__vv      ..33__77$$__vv            ..33__vv

      ..44__99||__^^          ..11__99++__^^          ..44__88$$__^^          ..44((__88$$__^^      ..11))__99++__^^      ..99((__^^          ..33::00&&__^^          ..44__99||__^^          ..44((__88$$__^^            ..99))__^^          ..11__99$$((__^^    ..@@

xx

The double newlines hurt, but at least this proves that it's doable!
Each character is printed one-by-one, first by forming the code point then printing a single char. The code points are formed by:
D 68  66))
o 111 44__99||
  32  33::00&&
n 110 11__99++
t 116 44__88$$
r 114 44((__88$$
e 101 99))
p 112 11))__99++
a 97  99((
y 121 22__99++
u 117 22__99$$
s 115 22__99))$$
l 108 33__77$$
f 102 11__99$$((
! 33  33

where
)(        Increment/decrement by 1 respectively
&|$       Bitwise AND/OR/XOR respectively
+         Add
:         Duplicate
_         Push zero
0-9       Pop n and push n*10+<digit>

The unusual behaviour of Labyrinth's digits is exploited in 33::00&&, which is actually
[33] -> [33 33] -> [33 33 33] -> [33 33 330] -> [33 33 3300] -> [33 32] -> [32]
     :          :             0              0               &          &

Each single char is printed with the mechanism
__vv

  ..

xx

The xx exist only to pad the grid so that it's 5 high. First the __ push two zeroes, then we hit a grid rotation operator v. We pop a zero and rotate:
__ v
  v
   .
  .
xx

and again:
__ v

  v.

xx.

We then move rightwards to the . on the third row, thus executing the print command only once.

I love the trick you used to execute the print command only once. That’s extremely clever.

CJam - 176 136 bytes
66))HH77++GG00++BB88++HH77++EE88++GG00++DD88++99))CC88++99))AA77++EE88++GG00++BB99++HH77++KK77++DD88++JJ77++99))AA88++II66++33]]{{cc}}//

Thanks to Sp3000 for dividing my program size by two :-)
Explanation

The codes HH77++, GG00++, ... compute the integer ascii code of the characters by adding numbers (for example: `HH77++' pushes 17, 17 and 77 on the stack, then add these 3 numbers)
the portion of code at the end ]]{{cc}}// loops through the ascii codes and convert them to characters.

Try it here

Did you generate this with a program? At the very least, the very end can be 33cc, but I'm sure there's better ways for some of the others

@Sp3000 yes, just ran a program that tried various combinations with ++. I haven't tried other operators...

Another note: instead of cc everywhere, do ]]{{cc}}// at the end

Self-modifying Brainf***, 72 bytes
Note that \x00 represents a literal NUL hex byte (empty cell). The source code is placed on the tape, left of the starting cell.
!!fflleessrruuooyy  ttaaeeppeerr  ttoonn  ooDD\0\0<<<<<<++[[<<]]<<[[..<<]]

Explanation
!!fflleessrruuooyy  ttaaeeppeerr  ttoonn  ooDD  The string on the tape for easy printing
\x00\x00                                        A separator to make printing shorter
<<<<<<++                                        Change first '.' to '0' (comment)
[[<<]]<<                                        Move to separator, then left to string
[[0.<<]]                                        Print string

Also, before making this program, I was making one using only BF characters in the source. It's possible! It's also much longer, since for an odd ASCII value, I was going to create double the value, then divide by two. Somewhat shorter would be modifying the entire source to generate odd values to start with.

Won't this output DDoo  nnoott  rreeppeeaatt  yyoouurrsseellff!! (double spaces)? I see two .s.

@EriktheGolfer Time for you to read my answer. Change first '.' to '0'. I changed the explanation to show (again) that the first . is changed to a zero.

Jelly, 66 bytes
““DDoo  nn““oott  rreepp““eeaatt  yyoouurrss““eellff!!””ṛṛḷḷWWQQ€€

Try it online!
Factoid
The program still works if you remove every second character.
Try it online!
How it works
““DDoo  nn““oott  rreepp““eeaatt  yyoouurrss““eellff!!”

returns an array of string. The literal begins with a “, ends with a ”, and the strings are delimited internally by “. The result is
["", "DDoo  nn", "", "oott  rreepp", "", "eeaatt  yyoouurrss", "", "eellff!!"]

The link's argument and the return value are set to this array of strings, then the remainder of the source code is executed.
<literal>”ṛṛḷḷWWQQ€€  Argument/return value: A (string array)

         ”ṛ           Yield the character 'ṛ'.
           ṛ          Select the right argument of 'ṛ' and A: A.
            ḷ         Select the left argument of A and A: A.
              W       Wrap; yield [A].
             ḷ        Select the left argument of A and [A]: A.
               W      Wrap; yield [A].
                Q     Unique; deduplicate [A]. Yields [A].
                 Q€€  Unique each each; for each string s in A, deduplicate s.

MSM, 270 160 bytes
!!'',,ff'',,ll'',,ee'',,ss'',,rr'',,uu'',,oo'',,yy'',,  '',,tt'',,aa'',,ee'',,pp'',,ee'',,rr'',,  '',,tt'',,oo'',,nn'',,  '',,oo'',,DD'',,......................

My first MSM program!
String output in MSM is done by pushing the individual characters onto the stack and joining them into a single string via ., e.g.
!olleH.....

The number of . is one less than the number of characters. For Do not repeat yourself! we need 22 .s. Luckily this is an even number, so we have 11 doubles
......................

Putting the letters in front of it requires some more effort. The pattern
cc'',,

does the trick for each character c. It evaluates as follows
cc'',,            push c (remember: commands are taken from the left and operate on the right)
c'',,c            push c
'',,cc            quote ' and push
,,cc'             pop
,cc               pop
c                 voilà!

We need 23 such patterns starting with !!'',, and ending with DD'',, followed by the 22 join commands ..

Gammaplex, 66 bytes
\\

XX""!!fflleessrruuooyy  ttaaeeppeerr  ttoonn  ooDD""XXXXrrRREE

Gammaplex is a 2D language that uses the position of the first newline as the line length, and ignore all other newlines.

Befunge 98, 70 66 bytes
Try it online!
After my invalid answer, here's a better one that actually fits the challenge!
2200**xx""!!fflleessrruuooyy  ttaaeeppeerr  ttoonn  ooDD��""kk,,@@

(Thanks to Martin Ender for suggesting the use of ��, character 0x17, instead of 88ff++)
Explanation:
2200          Push 2, 2, 0, and 0 onto the stack
*             Multiply 0 and 0, yielding 0
*             Multiply 2 and 0, yielding 0
              The stack is now [2, 0]
x             Pop a vector off the stack and set the instruction pointer delta to that
              The instruction pointer is now skipping over every other character, since the delta is (2, 0)
"!f ... oD�" Push the string onto the stack, with the number 23 (number of characters in the string) at the top
k,            Pop characters off the stack and print them, 23 times
@             End the program

You can save four bytes by using an unprintable character (code point 23) inside the string instead of 8f+: https://tio.run/nexus/befunge-98#@29kZGCgpVVRoaSkqJiWlpOTmlpcXFRUWpqfX1mpoFBSkpiYmlpQkJpaVATi5efn5Sko5Oe7uIiLKyllZ@voODj8/w8A

Backhand, 54 bytes
vv""!!fflleessrruuooyy  ttaaeeppeerr  ttoonn  ooDD""HH

Try it online!
Since Backhand's pointer already moving at three cells a tick, all we need to do is decrease that to 2 using v

That is surprisingly surprising

DC, 348 346 342 306 290 278 bytes
File dnr6.short.dc (without trailing newline):
AAzz--22222222vvPPAAAAAAAAvvPP88vvFFFFFFFFvv00++AAzz--PP11vvFFFFFFFFvv00++AAAAAAvvPP11vvEEEEEEEEvv00++OOOO//44999999vv++PP77II++OOOO//44999999vv++PPAAAAAAvv88vvFFFFFFFFvv00++PPAAzz--BBPP11vvFFFFFFFFvv00++77OOOO++++PPOOOO//44999999vv++66vvFFFFFFFFvv00++PP99zz++OO88++PPAAAAvv33PP

Run:
$ dc < dnr6.short.dc
Do not repeat yourself!

05AB1E, 100 58 52 bytes
-6 bytes thanks to Kevin Cruijssen
„„€€··™™……€€––  ……¹¹‚‚  ……––‚‚))εε##θθáá}}»»……!!θθJJ

Try it online!
„„€€·              # dictionary string "g do"
     ·             # double (no effect on strings)
      ™            # title case: "G Do"
       ™           # title case again (no effect)
……€€––             # dictionary string "tools not–"
                   # spaces necessary so "–…" isn't parsed as a dictionary word
……¹¹‚‚             # dictionary string "team repeat‚"
                   # spaces necessary again
……––‚‚             # dictionary string "j yourself‚"
)                  # wrap the entire stack in an array
 )                 # and again: [["G Do", "tools not–", "team repeat‚", "j yourself‚"]]
  ε        }       # for each:
   ε      }        #  for each:
    #              #   split on spaces: ["tools", "not–"]
     #             #   and again: [["tools", "not–"]]
      θ            #   get the last element: ["tools", "not–"]
       θ           #   and again: "not–"
        á          #   keep only letters: "not"
         á         #   and again (no effect)
            »      # join the list by newlines, joining sublists by spaces:
                   # "Do not repeat yourself"
             »     # join the stack by newlines, joining lists by spaces (no effect)
……!!               # literal string "…!!"
    θ              # get the last character: "!"
     θ             # and again (no effect)
      J            # join the stack without separators: "Do not repeat yourself!"
       J           # and again (no effect)
                   # implicit output

Idempotency rules.

Nice answer, I'm impressed you were able to squeeze in the dictionary strings like that! It's unfortunately that á doesn't vectorizes on the inner strings, otherwise it could be used after the )).. Removing all á and using εεáá}} after the )) works as alternative, but unfortunately it doesn't save any bytes (but maybe you can find inspiration from it?).. And „„!! instead of ……!! work as well, since the ! builtin leaves the strings the same apparently. Ah well, I tried. xD

@KevinCruijssen I've been trying to refactor those repeated ##θθáá for a while, and for some reason I didn't consider εε}}... I tried €€, which doesn't quite work... This is now the shortest answer, thanks!

BotEngine, 6x49=294
vv  PP

  !!ee

  ffee

  llee

  eeee

  ssee

  rree

  uuee

  ooee

  yyee

    ee

  ttee

  aaee

  eeee

  ppee

  eeee

  rree

    ee

  ttee

  ooee

  nnee

    ee

  ooee

  DDee

>>  ^^

reticular, noncompeting, 62 bytes
2200**UU""DDoo  nnoott  rreeppeeaatt  yyoouurrsseellff!!""oo;;

Try it online!
Explanation in parts:
2200**
2200    the stack looks like [2 2 0 0]
    *   [2 2 0*0]
     *  [2 2*0*0]
        [2 0]

U sets the pointer direction to (2, 0), that is, moving 2 x-units and 0 y-units, so it skips every other character, starting with the next U being skipped. Then, every other character is recorded, and it is equivalent to:
"Do not repeat yourself!"o;

which is a simple output program.
Other
This is competing for WallyWest's JavaScript bounty:
I can prove that, while numbers can be constructed under this restriction, strings cannot. Since no literals can be used, as the placement of any literal-building character would create an empty string:
""
''
``

Then, only some operator can be used; the only "paired" operators used are:
++ -- << >> ** ~~ || && !! ==

And none of these can cast numbers/others to strings. So no strings can be outputted.

Alice, 74 bytes
aa00tt,,JJ""DDoo  nnoott  rreeppeeaatt  yyoouurrsseellff!!//@@""ooYY;;tt

Try it online!
Explanation
The first catch is that we need to be able to enter the string, so we want to skip only the first ". We do this by jumping onto the first " because then the IP will move one cell before looking at the current cell again, so that it's the second " which enters string mode. But to be able to jump there, we need 10, 0 on top of the stack, in that order (second, top). This is done with aa00tt,,:
                          Stack:
aa   Push two 10s.        [... 10 10]
00   Push two 0s.         [... 10 10 0 0]
tt   Decrement twice.     [... 10 10 0 -2]
,    Rotate(-2).          [... 0 10 10]
,    Rotate(10).          [... 0 10 0]

This rotation function pops an argument. If that argument is negative, it pushes the value on top of the stack down by that many positions. If the argument is positive, it goes looking for the element that many positions below the top and pulls it up to the top. Note that in the case of Rotate(10), there aren't enough elements on the stack, but there is an implicit infinite amount of zeros at the bottom, which is why a zero ends up on top.
Now we can Jump onto the first " using these two arguments. The second " enters string mode and records all of that DDoo  nnoott.... When it hits the /, the IP is redirected southeast and we enter Ordinal mode. For now on the IP bounces up and down across the three lines (two of which are empty), so it first records three more spaces on lines two and three and then we leave string mode when it hits the ". Since we're in Ordinal mode at this time, all the recorded characters are pushed as a single string to the stack (even though we recorded most of them in Cardinal mode), so we end up with this string (note the trailing spaces):
DDoo  nnoott  rreeppeeaatt  yyoouurrsseellff!!

Now the IP keeps bouncing up and down which means that it executes one command of every other pair, i.e. Y and t. Then the IP will hit the end of the grid on the second line and start bouncing backwards through the grid. This also switches in which pair of characters the IP hits the first line, so when going back it now executes ;, o and @. So ignoring all the spaces and implicit IP redirections, the executed code is Yt;o@ in Ordinal mode.
The Y is the "unzip" command which separates a string into the characters in alternating positions. Since each character is repeated, that really just gives us two copies of the string we're going for, although the first copy has two trailing spaces and the second has one trailing space. t splits off that trailing space and ; discards it. Finally, o prints the string and @ terminates the program.

Stax, 70 bytes
GG11hh::zzaapp..}}..""DDoo  nnoott  rreeppeeaatt  yyoouurrsseellff!!""

Run and debug it at staxlang.xyz!
Stax very fortunately has the builtin :: for every-nth. All I need to is push the string doubled, push 2, and run ::. Easy, right?
Wrong.
Pushing that string is tricky. The first quotation mark can be doubled by .."", which is a length-2 literal for ." followed by a meaningful quotation mark. Problem is, I see no way to terminate the string (which is necessary, or else the doubled version will be printed) without starting a new one.
The end of the program terminates string literals. If I can put this doubled literal there, perhaps there'll be a nice workaround. To jump somewhere from the end of a program, however, requires G}, so at minimum, I'm looking at this:
GG [deduplicate] }}""DDoo  nnoott  rreeppeeaatt  yyoouurrsseellff!!""

This does... nothing. G does not begin a block, so neither will jump to the second }. Again, I need to ignore one character: ..}}. Execution jumps from the first G to the second }, continues to the end, jumps back to the second G and from there to the second }, and continues once more to the end before resuming at the start of the [deduplicate] section with the doubled string atop the stack.
Deduplication is simple. 11hh pushed eleven and halves it twice, rounding down both times and yielding two, and :: will then get us the output we need.
GG11hh::..}}..""DDoo  nnoott  rreeppeeaatt  yyoouurrsseellff!!""

Uh-oh. This prints nothing. There are two problems here: first, that ..} means the string .} will be atop the stack at the end of the program, and second, Stax's ordinary implicit output is now disabled!
The worse issue is the output. When a Stax program terminates gracefully without printing anything, the top of the stack will be implicitly printed. But we haven't printed anything...? Ah, but we have. Unterminated string literals are printed rather than pushed, and even those two empty strings (from the unmatched " at the end), despite being empty, are enough to trip this check. Any printing must be done by hand.
We'll need either pp or PP, and in this instance, ignoring the first through ..pp is unacceptable, as it will print the string .p. That means we need our desired output either alone on the stack or in the top two along with an empty string. This latter is accomplished by pushing two empty strings (zz) and rotating the top three items twice (aa) before printing.
Once that's done, we have a stack four strings tall. A fifth, .}, is then pushed before the program exits gracefully; at this point, the lack of implicit output becomes a blessing as well as a curse, as nothing extra will now be printed!

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Karel J. AlphaBot Sequence Generator
Scores
This section will be filled in as submissions are entered.
Normal
1. bopjesvla    Perl                54
2. edc65        Javascript (ES6)    91
3. name         language            score
4. name         language            score
5. name         language            score

Bonus Round
1. name   language   score
2. name   language   score
3. name   language   score
4. name   language   score
5. name   language   score

Karel J. AlphaBot
Background
A popular introductory course to Java is Karel J. Robot (I'm using it myself). The robot interacts with a grid of streets (positive integer y-coordinates) and avenues (positive integer x-coordinates) as well as beepers, which can be placed and stored on the grid (note that Karel and any beepers can only exist on lattice points). Karel (the robot) is only to perform five actions: move forward by 1, turn left in place, put down a beeper, pick up a beeper, and turn itself off.
In my Computer Science class, one of our first assignments was to program Karel to learn how to turn right, turn around, and perform the combined action of moving forward by 1 and putting down a beeper. An assignment a few days later was to use these methods and write new methods to produce letters of the alphabet.
Naturally, once I finished this assignment, I wrote more methods to make every letter of the alphabet, as well as the ten numerical digits, and I plan to figure out how to make a sort of word processor out of the robot, where a string would be entered to STDIN and the robot would put beepers on the grid in a way that resembled the letters.
Every time I wrote private void draw# for each character #, I added a comment after it that would tell me abbreviations for the sequence of commands I'd need.
I have the following commands (written in pseudocode) at my disposal (clarification - these are the only useful commands).
Turn Left
    Rotate the robot 90˚ counterclockwise
    Abbreviated as "l"

Turn Right
    Rotate the robot 90˚ clockwise
    Abbreviated as "r"

Move
    Move one space forwards
    Abbreviated as "m"

Put Beeper
    Put a beeper on the spot that Karel is on
    Abbreviated as "p"

Drop Beeper
    Move, then Put Beeper
    Abbreviated as "d"

Turn Around
    Turn Left, then Turn Left
    Abbreviated as "a"

Conditions
The robot must proceed in the following order.

The robot starts on the bottom left corner of the 5xN rectangle of minimal area the letter will be drawn in.
The robot draws the letter.
The robot moves to the bottom right corner of the rectangle.
The robot moves two spaces to the right and must face north/up

Let's work through an example. Suppose we want to draw A. The location of the robot is the letter that indicates its direction (north, south, east, west). The letter is capitalized if the robot is on a spot with a beeper and lowercase if the robot is on a spot without a beeper. o represents spots with beepers and . represents spots without beepers.
As we will see later, A is this.
.ooo.
o...o
ooooo
o...o
o...o

Here is one possible solution.
Grids   .....   .....   .....   .....   .....   .....   .....   .....   .....
        .....   .....   .....   .....   .....   .....   .....   .....   .....
        .....   .....   .....   N....   E....   oE...   ooE..   oooE.   oooW.
        .....   .....   N....   o....   o....   o....   o....   o....   o....
        n....   N....   o....   o....   o....   o....   o....   o....   o....

Letters           p       d       d       r       d       d       d       a

        .....   .....   .....   .....   .....   n....   e....   .E...   .oE..
        .....   .....   .....   .....   N....   o....   o....   o....   o....
        ooWo.   oWoo.   Wooo.   Nooo.   oooo.   oooo.   oooo.   oooo.   oooo.
        o....   o....   o....   o....   o....   o....   o....   o....   o....
        o....   o....   o....   o....   o....   o....   o....   o....   o....

          m       m       m       r       d       m       r       d       d

        .ooE.   .oooe   .ooos   .ooo.   .ooo.   .ooo.   .ooo.   .ooo.
        o....   o....   o....   o...S   o...o   o...o   o...o   o...o
        oooo.   oooo.   oooo.   oooo.   ooooS   ooooo   ooooo   ooooo
        o....   o....   o....   o....   o....   o...S   o...o   o...o
        o....   o....   o....   o....   o....   o....   o...S   o...E

          d       m       r       d       d       d       d       l

The final mml to complete the fourth bullet is implicit because it appears in every letter and because I don't want to go back and add another two columns to everything in the above proposed solution.
Thus, one solution to make A is pddrdddammmrdmrdddmrddddlmml.
Note that this doesn't have to be your solution. Your algorithm can go through every column, putting beepers in the proper places and not relying on where other beepers have been placed or will be placed. No matter what your algorithm is, the robot can only place one beeper per space on the grid.

The program
Your program will take as its input a 5xN grid of what the grid for the letter is. Note that there is no robot on the input; the robot is assumed to be on the bottom left (southwest) corner, facing north.
The output will be the sequence of letters that are the shorthand for the sequence.
Sample inputs
.ooo.
o...o
ooooo
o...o
o...o

o...o.ooooo
o...o...o..
ooooo...o..
o...o...o..
o...o.ooooo

Sample outputs
pddrdddammmrdmrdddmrddddlmml

prmmmlmlmmdrdrdddlmlmmdrdrmmmdrddddlmmlprdddlmldmmrmrmdmlmldmmrdrddddrmmmdlmml

This is code golf, fellas. Standard CG rules apply. Shortest code in bytes wins.

Bonus Round
Rules
If you want to participate in the bonus round, be sure to make your codes move-efficient! Below is a library of all of the 5x5 letters my program creates when it runs. The objective of the bonus round is to write a program that prints a sequence for ABCDEFGHIJKLMNOPQRSTUVWXYZ that contains as few moves as possible. There is no input to STDIN. Code will be graded not on the length of the code but on its "move score." The move score is designed to discourage sweeper algorithms that visit every point in the rectangle.
d: 1
l: 1
m: 4
p: 1
r: 1

Letters
.ooo.   oooo.   ooooo   oooo.   ooooo   ooooo   .oooo   o...o
o...o   o...o   o....   o...o   o....   o....   o....   o...o
ooooo   oooo.   o....   o...o   oooo    oooo.   o.ooo   ooooo
o...o   o...o   o....   o...o   o....   o....   o...o   o...o
o...o   oooo.   ooooo   oooo.   ooooo   o....   oooo.   o...o

ooooo   ....o   o...o   o....   ooooo   o...o   ooooo   oooo.
..o..   ....o   o..o.   o....   o.o.o   oo..o   o...o   o...o
..o..   ....o   oo...   o....   o.o.o   o.o.o   o...o   oooo.
..o..   o...o   o..o.   o....   o...o   o..oo   o...o   o....
ooooo   .ooo.   o...o   ooooo   o...o   o...o   ooooo   o....

oooo.   oooo.   ooooo   ooooo   o...o   o...o   o...o   o...o
o..o.   o...o   o....   ..o..   o...o   o...o   o...o   .o.o.
o..o.   oooo.   ooooo   ..o..   o...o   .o.o.   o.o.o   ..o..
oooo.   o..o.   ....o   ..o..   o...o   .o.o.   o.o.o   .o.o.
....o   o...o   ooooo   ..o..   ooooo   ..o..   ooooo   o...o

o...o   ooooo
.o.o.   ...o.
..o..   ..o..
.o...   .o...
o....   ooooo

The same procedure as the original challenge must be followed: letters must be drawn one at a time with a space separation between each letter.
Standard CG rules apply. Entry with the lowest move score wins.

To summarize, both codes will essentially do the same things. The first code should have a minimal number of bytes in the code, and the second code should use the smallest number of moves.

Neat challenge - no idea why you're getting downvoted.

Thanks @Deusovi. I wish they'd explain why so I can clear up anything that doesn't make sense or improve it.

"Karel (the robot) is only to perform five actions": I think you're missing "able", and you're definitely missing the fifth action. And I'm not sure what the bonus round is about: are you going to award a bounty to the person who writes the best solution?

Perhaps instead of a code golf challenge change it to a minimal move golf challenge?  Since this is about efficiency.

@PeterTaylor I think I'll add a bounty in two days, yes. I added a clarification explaining the difference between the first part and the bonus round. The code golf part for the bonus round was removed, as Luk suggested.

A minimal move challenge with a limited set of moves isn't that interesting without the code golf part. It should be pretty easy to BFS the optimal path.

Yes it is. Thanks for the catch.

As already said by @bopjesvla, you can expect that most of (all?) the answer to the bonus challenge will find the minimum move score.

On second thought, the bonus challenge has a bigger pitfall: fixed input. That's always a bad idea.

@edc65 That's the point of the bonus challenge. Standard CG rules apply. Entry with the lowest move score wins.

About fixed input challenges: http://meta.codegolf.stackexchange.com/a/1063/21348

Can I put down a beeper where a beeper already is?
In the bonus chalange: Do I have to put out the letter one after the other or can I write half an A then half a B and then the rest of the A?
In the Bonus chalange do I have to stop two fields right from the Z facing north?

The 'move score' for 'r' is missing. It should be 1, I presume

I'm trying to tackle the bonus challenge now. About the 'a' command: the score is 2, the effect is the same as 'rr' or 'll' that score 2. All in all, no use for 'a' command.

Updated accordingly. Future challenges from me will hopefully catch those errors.

I finally put the output together: http://pastebin.com/59sASxvz

@bopjesvla nice and useful, thanks

Bonus OK! Not optimal but it's scoring well (scoring top really, as there is just one contender)

perl -p0, 60 56 54+2 bytes
golf
/
/;$:="m"x"@-";$_=mmmmlma.s/
/rmr$:a/gr.mml;y/.o/md/;

notes
/\n/; # capture the length of the first line
$:="m"x"@-"; # assign a string of m's with that length to $:
s/^/mmmmlmll/; # move to the starting position (-1,0)
s/\n/rmr$:rr/g; # replace all newlines with kareliage returns
y/.o/md/; # replace dots with moves and o's with drops
s/$/mml/; # append mml

Nice use of @-, might be a useful one to share on the tips for golfing in Perl question!

JavaScript (ES6), 91
A first try to the basic challenge.
Test running the snippet below in an EcmaScript 6 compliant browser (tested in Firefox)

// BASIC CHALLENGE ANSWER

f=s=>`mmmmr${[...s].map(c=>c<' '?[`mrmr${b}a`,b=m][0]:(b+=m,c>m?'pm':m),b=m='m').join``}ml`

/* ALSO ...
f=s=>`mmmmr${s.replace(/.|\s/g,c=>c<' '?[`mrmr${b}a`,b=m][0]:(b+=m,c>m?'pm':m),b=m='m')}ml`
*/

// TEST
// now, I need to implement Karel (and test it) to do a significant test
// (a super limited version of Karel, of course. Just what is needed)

Karel=(cmd, width, height) =>  // even if for this test we have a limited height to handle
{
  var grid = [...('.'.repeat(width)+'\n').repeat(height)],
  o = width+1,
  p = o*(height-2)+1,
  d = [-o, 1, o, -1], // direction offsets
  q = 0, // face up
  s = [...grid],
  steps = [];

  s[p] = 'n';
  steps.push([s.join``,'-']);

  [...cmd].forEach(c =>
    (
      c == 'l' ? q = q-1 &3
      : c == 'r' ? q = q+1 &3
      : c == 'a' ? q = q+2 &3
      : c == 'm' ? p += d[q]
      : c == 'p' ? grid[p] = 'o'
      : c == 'd' ? grid[p += d[q]] = 'o'
      : 0,
      s = [...grid],
      s[p] = s[p] == 'o' ? 'NESW'[q] : 'nesw'[q],
      steps.push([s.join``,c])
    )
  )
  return [s.join``,steps]
}
function go(cmd)
{
  var result = Karel(cmd,260,7)
  RESULT.innerHTML = result[0];
  STEPS.innerHTML = 'Steps:
'+result[1].map(x=>'
'+x.join('\n')+'
').join('')
}
function test(input)
{
  var exp = input.innerHTML;
  var cmd = f(exp);
  var result = Karel(cmd,20,7)
  CMD.innerHTML = cmd;
  RESULT.innerHTML = result[0];
  STEPS.innerHTML = 'Steps:
'+result[1].map(x=>'
'+x.join('\n')+'
').join('')
}
pre {
  float: left;
  border: 1px solid #888;
  margin: 2px
}

div {
  clear: both;
}

#CMD {
  word-break: break-all;
  white-space: normal;
  width:50%;
  overflow:auto;
}

#Y {
  width:50%;
}
Test cases (click to run a test)

.ooo.
o...o
ooooo
o...o
o...o

o...o.ooooo
o...o...o..
ooooo...o..
o...o...o..
o...o.ooooo

Command string:

Your Command:
<input id=Y><button onclick='go(Y.value)'>-></button>

Result:

Steps

BONUS CHALLENGE ANSWER - Score for full alphabet=869
Test running the wnippet below in Firefox (better full screen)
As I don't like fixed input/fixed output challenges, you can try your input. Just remember, only letters will be printed.

// Optimal - working on small pattern but too slow (scale bad)
// So I build the total command letter by letter - that surely is NOT globally optimal

Key=sol=>sol.pos+' '+sol.setBits

Solve=(target, startRow, startDir, cmd)=>{
  // Target is a rectangle string 5x5, newline separated for total (5+1)*5 chars
  if (target[target.length-1] != '\n') target += '\n';

  var T = ~new Date()
  var width = 5, height = 5, startPos = (width+1)*startRow;
  var offset = [-width-1, 1, width+1, -1];
  var turns = [ "", "r", "rr", "l" ];
  var cmds = [ "m", "rm", "rrm", "lm", "d", "rd", "rrd", "ld" ];
  var visited = {}, scan =[[],[],[],[],[],[],[],[]], cscan;

  var baseSol = { steps:[], pos: startPos, dir: startDir, setBits: 0};
  var score = 0, j = 0
  var bit, key, turn, curSol, move, result
  var targetBits = 0;
  [...target].map((c,i)=>targetBits |= ((c=='o')<<i)) // 30 bits

  // First step, from outside, set bit in mask if it's set in target
  if (target[startPos]=='o') baseSol.setBits = 1<<startPos;
  console.log(target, targetBits.toString(16))
  visited[Key(baseSol)] = scan[0].push(baseSol);

  for (j = 0; j<99; j++)
  {
     cscan = scan[j];
     scan.push([])

     // console.log(`T: ${T-~new Date} J: ${j} SC: ${cscan.length}`)
     while (cscan.length > 0)
     {
        baseSol = cscan.pop()
        //console.log('Base', baseSol.dir, baseSol.pos, baseSol.setBits.toString(16), baseSol.steps.length)
        for(turn = 0; turn < 4; turn++)
        {
           // set direction, move and drop if you can
           curSol = {};
           curSol.dir = baseSol.dir + turn & 3;
           curSol.pos = baseSol.pos + offset[curSol.dir];
           // console.log(turn, curSol.dir, curSol.pos)
           if(target[curSol.pos] > ' '
              || curSol.dir == 1 && target[curSol.pos]=='\n'
             ) // if inside grid or on right border facing east
           {
              score = j + (turn == 2 ? 3 : turn == 0 ? 1 : 2);
              bit = 1 << curSol.pos;
              if (targetBits & bit)
                 curSol.setBits = baseSol.setBits | bit, move = 4 | turn;
              else
                 curSol.setBits = baseSol.setBits, score += 3, move = turn;
              if (!visited[key = Key(curSol)])
              {
                 curSol.steps = [...baseSol.steps, move] // clone and add
                 // task completed if on  right border and all bits ok
                 if (target[curSol.pos]>' ')
                 { // not on right border, proceed
                    visited[key] = scan[score].push(curSol)
                 }
                 else if (curSol.setBits == targetBits)
                 {
                    result = curSol.steps.map(v=>cmds[v]).join``
                    result = (cmd == ''
                    ? target[startPos]=='o' ? 'p' : ''
                    : target[startPos]=='o' ? 'd' : 'm') + result;
                    console.log(`T: ${T-~new Date} J: ${j} CMD: ${result}`)
                    return [cmd+result, curSol.pos / (width+1) | 0];
                 }
              }
           }
        }
     }
  }
  // Miserable failure!
  return []
}

console.log=(...x)=>LOG.innerHTML+=x+'\n';
// TEST
Karel=(cmd, width, height) =>  // even if for this test we have a limited height to handle
{
  var grid = [...('.'.repeat(width)+'\n').repeat(height)],
  o = width+1,p = o*(height-2)+1,d = [-o, 1, o, -1], // direction offsets
  steps = [],s = [...grid],q = 0; // face up

  s[p] = 'n';
  steps.push([s.join``,'-']);

  [...cmd].forEach(c =>
    (
      c == 'l' ? q = q-1 &3
      : c == 'r' ? q = q+1 &3
      : c == 'a' ? q = q+2 &3
      : c == 'm' ? p += d[q]
      : c == 'p' ? grid[p] = 'o'
      : c == 'd' ? grid[p += d[q]] = 'o'
      : 0,
      s = [...grid],
      s[p] = s[p] == 'o' ? 'NESW'[q] : 'nesw'[q],
      steps.push([s.join``,c])
    )
  )
  return [s.join``,steps]
}

var AlphabetMap = `.ooo..oooo..ooooo.oooo..ooooo.ooooo..oooo.o...o.ooooo.....o.o...o.o.....ooooo.o...o.ooooo.oooo..oooo..oooo..ooooo.ooooo.o...o.o...o.o...o.o...o.o...o.ooooo
o...o.o...o.o.....o...o.o.....o.....o.....o...o...o.......o.o..o..o.....o.o.o.oo..o.o...o.o...o.o..o..o...o.o.......o...o...o.o...o.o...o..o.o...o.o.....o.
ooooo.oooo..o.....o...o.oooo..oooo..o.ooo.ooooo...o.......o.oo....o.....o.o.o.o.o.o.o...o.oooo..o..o..oooo..ooooo...o...o...o..o.o..o.o.o...o.....o.....o..
o...o.o...o.o.....o...o.o.....o.....o...o.o...o...o...o...o.o..o..o.....o...o.o..oo.o...o.o.....oooo..o..o......o...o...o...o..o.o..o.o.o..o.o...o.....o...
o...o.oooo..ooooo.oooo..ooooo.o.....oooo..o...o.ooooo..ooo..o...o.ooooo.o...o.o...o.ooooo.o.........o.o...o.ooooo...o...ooooo...o...ooooo.o...o.o.....ooooo`.split('\n')
var LetterMap = [];
var l,row,m;

for (l=0;l<26;l++)
{
  for(m='',row=0;row<5;row++)
    m += AlphabetMap[row].substr(l*6,5)+'\n'
  LetterMap[l]=m;
}

print=Message=>{
  var Alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
  var startRow = 4, cmd=''
  var startDir = 0 // start facing UP
  ;[...Message].forEach(l => (
    [cmd, startRow] = Solve(LetterMap[Alphabet.search(l)], startRow, startDir, cmd),
    startDir = 1, // after each letter will be facing RIGHT
    cmd += '\n' // addin a newline (scoring 0) just for readability
  ))

  if (startRow != 4)
    cmd += 'mr'+'m'.repeat(4-startRow)+'rr' // on last row and facing up
  else
    cmd += 'ml' // ...facing up

  // Recalc score
  var score = 0
  ;[...cmd].forEach(c=>score += c=='m'? 4 : c<' '? 0: 1)

  var robot = Karel(cmd.replace(/\n/g,''), 26*7, 7)
  O.innerHTML=cmd+'\nScore:'+score
  R.innerHTML=robot[0]
  RS.innerHTML=robot[1].join`\n`
}

function test()
{
  var msg = I.value.toUpperCase()
  msg=msg.replace(/[^A-Z]/g,'')
  I.value=msg
  print(I.value)
}

test()
fieldset {
  padding:0;
}

pre {
  margin: 2px;
}

#RS {
  height: 200px;
  width: 50%;
  overflow:auto;
}

#I { width: 50% }
<fieldset ><legend>Message to print</legend>
<input id=I value='ABCDEFGHIJKLMNOPQRSTUVWXYZ'><button onclick='test()'>go</button></fieldset>
<fieldset ><legend>Command Result (newlines added for readability)</legend>

</fieldset>
<fieldset ><legend>Robot output</legend>

</fieldset>
<fieldset ><legend>Robot step by step</legend>

</fieldset>
<fieldset ><legend>log</legend>

</fieldset>

How's the bonus going?

@Eridan the bonus is going well. Unfortunately I have a job too ... :)

Ok! I don't blame you. You're the only one who's attempted the bonus.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
The Euclidean Algorithm (for finding the greatest common divisor)
The Challenge
Write a program or function that takes two input integers, i and j, and outputs their greatest common divisor; calculated by using the Euclidean algorithm (see below).

Input
Input may be taken as a space-delimited string representation of i and j or as two separate integers. You can assume that integers will be less than or equal to 10,000. You can also assume that the input integers will not be prime to one another.

Euclidean Breakdown
The larger number between i and j is divided by the smaller as many times as possible. Then, the remainder is added. This process is repeated with the remainder and the previous number, until the remainder becomes 0.
For example, if the input was 1599 650:
1599 = (650 * 2) + 299
 650 = (299 * 2) +  52
 299 =  (52 * 5) +  39
  52 =  (39 * 1) +  13
  39 =  (13 * 3) +   0

The final number, 13, is the greatest common divisor of the two input integers. It can be visualized like this:

Output
Your output must be the breakdown in the form above, followed by a newline and the GCD. It can be output through any medium.

Examples
Inputs
18 27
50 20
447 501
9894 2628

Outputs
27 = (18 * 1) + 9
18 =  (9 * 2) + 0
9

50 = (20 * 2) + 10
20 = (10 * 2) +  0
10

501 = (447 * 1) + 54
447 =  (54 * 8) + 15
 54 =  (15 * 3) +  9
 15 =   (9 * 1) +  6
  9 =   (6 * 1) +  3
  6 =   (3 * 2) +  0
3

9894 = (2628 *  3) + 2010
2628 = (2010 *  1) +  618
2010 =  (618 *  3) +  156
 618 =  (156 *  3) +  150
 156 =  (150 *  1) +    6
 150 =    (6 * 25) +    0
6

Note: Outputs do not have to be spaced as they are above. The spacing is only for clarity. Parentheses are required.

Bonus
If your output is spaced as above, you may add a -10% bonus to your score.

Can we assume the largest number is given first? 2. For the bonus, you mean the field width should be constant and just enough to allow for one space before the largest number? (with the spaces coming before the left parenthesis in the second column of numbers.) You should avoid ambiguous phrasing such as "as they are above" when the output is variable. It's OK if the required output is fixed.

Ok I see some examples have the largest number second

Your original title was OK, I've commented on what happened at http://meta.codegolf.stackexchange.com/q/7043/15599 . The phrase "greatest common denominator" was wrong however. "Denominator" relates to fractions. Googling "greatest common denominator" only gives results for "greatest common divisor / factor."

I thought the title was OK, but I changed it to "The" as to not displease anyone. Thanks for editing in "divisor", BTW. @steveverrill

Pyth, 33 bytes
ASQWGs[H\=\(G\*/HG\)\+K%HG)A,KG)H

Try it online: Demonstration or Test Suite
Explanation:
ASQWGs[H\=\(G\*/HG\)\+K%HG)A,KG)H
  Q                                read the two numbers from input
 S                                 sort them
A                                  and assign them to G and H
   WG                              while G != 0:
                      K%HG           assign H mod G to K
     s[H\=\(G\*/HG\)\+K   )          join the following list items and print:
                                        H=(G*(H/G))+K
                           A,KG      assign K, G to G, H
                               )   end while
                                H  print H

CJam, 46 43 39 bytes
q~]$3*~\{N5$"=("3$:G'*3$Gmd")+"\}h]7>NG

Try it online in the CJam interpreter.
How it works
q~]    e# Read all input, evaluate it and wrap the results in an array.
$3*    e# Sort the array and repeat it thrice.
~\     e# Dump the array and swap its last two elements.
{      e# Do:
  N    e#   Push a linefeed.
  5$   e#   Copy the sixth topmost element from the stack.
  "=(" e#   Push that string.
  3$:G e#   Copy the fourth topmost element from the stack. Save it in G.
  '*   e#   Push that character.
  3$   e#   Copy the fourth topmost element from the stack.
  Gmd  e#   Push quotient and remainder of its division by G.
  ")+" e#   Push that string.
  \    e#   Swap the string with the remainder.
}h     e#   If the remainder is positive, repeat the loop.
]7>    e# Wrap the stack in an array and discard its first seven elements.
NG     e# Push a linefeed and G.

Python 2, 70
f=lambda a,b:b and'%d=(%d*%d)+%d\n'%(a,b,a/b,a%b)*(a>=b)+f(b,a%b)or`a`

A recursive function that returns a multiline string. The function creates the first line, then appends it to the recursive result with the next pair of numbers in the Euclidean algorithm. Once the second number is zero, we take the string of the other number as the base case, causing it to be printed on its own line at the end.
The formatting is done via string substitution, using integer division to get the multiplicand.
One hiccup is needing to start with the larger number being taken mod the smaller number. Conveniently, if the numbers are in the wrong order, the first step of the Euclidian algorithm flips them. To prevent this step from being displayed, only add the current line if the first number is at least the second (equality is needed for, say f(9,9)).

awk, 78 77
x=$1{for(x<$2?x+=$2-(y=x):y=$2;t=y;x=t)print x"=("y"*"int(x/y)")+",y=x%y}$0=x

Sorting the input by size takes a lot of bytes :/
It comes down to this:
x=$1;
if(x<$2) x+=$2-(y=x); # add $2 subtract $1 and set y to $1
else y=$2;            # set y to $2

Output

650 1599            (input)
1599=(650*2)+ 299
650=(299*2)+ 52
299=(52*5)+ 39
52=(39*1)+ 13
39=(13*3)+ 0
13

Just for the fun of it I made a properly spaced version too, giving me a score of 233 * 0.9 == 209.7 bytes.
Update I was able to shorten this from 285 bytes and now it works for arbitrarily long numbers if calling gawk4 with the -M option.
x=$1{x<$2?x+=$2-(y=x):y=$2;a=length(x);b=length(y);for(d=length(x%y);t=y;x=t){$++i=x;$++i=y;if(c<l=length($++i=int(x/y)))c=l;$++i=y=x%y}while(j<NF)printf "%"a"d = %"b-length($(j+2))"s(%d * %"c"d) + %"d"d\n",$++j,_,$++j,$++j,$++j}$0=x

But I still got a feeling I ran into some mental block there somewhere...
Output (gawk4 called with awk -M -f code.awk)

6837125332653632513763 18237983363879361  (input)
6837125332653632513763 = (18237983363879361 * 374883) + 15415252446024000
     18237983363879361 = (15415252446024000 *      1) +  2822730917855361
     15415252446024000 =  (2822730917855361 *      5) +  1301597856747195
      2822730917855361 =  (1301597856747195 *      2) +   219535204360971
      1301597856747195 =   (219535204360971 *      5) +   203921834942340
       219535204360971 =   (203921834942340 *      1) +    15613369418631
       203921834942340 =    (15613369418631 *     13) +      948032500137
        15613369418631 =      (948032500137 *     16) +      444849416439
          948032500137 =      (444849416439 *      2) +       58333667259
          444849416439 =       (58333667259 *      7) +       36513745626
           58333667259 =       (36513745626 *      1) +       21819921633
           36513745626 =       (21819921633 *      1) +       14693823993
           21819921633 =       (14693823993 *      1) +        7126097640
           14693823993 =        (7126097640 *      2) +         441628713
            7126097640 =         (441628713 *     16) +          60038232
             441628713 =          (60038232 *      7) +          21361089
              60038232 =          (21361089 *      2) +          17316054
              21361089 =          (17316054 *      1) +           4045035
              17316054 =           (4045035 *      4) +           1135914
               4045035 =           (1135914 *      3) +            637293
               1135914 =            (637293 *      1) +            498621
                637293 =            (498621 *      1) +            138672
                498621 =            (138672 *      3) +             82605
                138672 =             (82605 *      1) +             56067
                 82605 =             (56067 *      1) +             26538
                 56067 =             (26538 *      2) +              2991
                 26538 =              (2991 *      8) +              2610
                  2991 =              (2610 *      1) +               381
                  2610 =               (381 *      6) +               324
                   381 =               (324 *      1) +                57
                   324 =                (57 *      5) +                39
                    57 =                (39 *      1) +                18
                    39 =                (18 *      2) +                 3
                    18 =                 (3 *      6) +                 0
3

Some newlines and tabs added
x=$1{
    x<$2?x+=$2-(y=x):y=$2;
    a=length(x);
    b=length(y);
    for(d=length(x%y);t=y;x=t)
    {
        $++i=x;
        $++i=y;
        if(c<l=length($++i=int(x/y)))c=l;
        $++i=y=x%y
    }
    while(j<NF)
        printf "%"a"d = %"b-length($(j+2))"s(%d * %"c"d) + %"d"d\n",
                                               $++j,_,$++j,$++j,$++j
}$0=x

I can save the lengths of the initial values for x, y and x%y in the beginning, because they can only get shorter each step. But for the factor I have to determine the maximum length before printing anything, because it's length can vary.
I use $i as an array here, because it saves two characters compared to using a[i] every time.

C++, GCC compiler, 171 bytes( -10%, so 154 bytes)
okay so my first try..
#include<iostream>
using namespace std;
int main()
{
    int a,b,c;
    cin>>a>>b;
    if(a<b)
    swap(a,b);
    while(b>0)
    {
        c=a;
        cout<<a<<" = ("<<b<<" * "<<a/b<<") + "<<a%b<<endl;
        a=b;
        b=c%b;
    }
    cout<<a;
}

tips to code golf appreciated.
P.S. Is it necessary to count bytes of standard header files and int main while using c++? Excluding it reduces 50 bytes

Note: I excluded the white space used to make the code pretty.

T-SQL (2012+), 268 bytes
Implemented as an inline table function that executes a recursive CTE.  Might be worthwhile trying to put formatting in for the 10% bonus, but that will have to wait.
CREATE FUNCTION E(@ INT,@B INT)RETURNS TABLE RETURN WITH M AS(SELECT IIF(@<@B,@B,@)A,IIF(@>@B,@B,@)B),R AS(SELECT A,B,A/B D,A%B R FROM M UNION ALL SELECT B,R,B/R,B%R FROM R WHERE 0<>R)SELECT CONCAT(A,'=(',B,'*',D,')+',R)R FROM R UNION ALL SELECT STR(B)FROM R WHERE R=0

Explanation and usage:
--Create the function
CREATE FUNCTION E(@ INT,@B INT)RETURNS TABLE RETURN
WITH
    --Order the input correctly
    M AS (
          SELECT IIF(@<@B,@B,@)A,
                 IIF(@>@B,@B,@)B
          )
    --Recursive selection
    ,R AS (
          SELECT A,B,A/B D,A%B R FROM M -- Anchor query
          UNION ALL
          SELECT B,R,B/R,B%R FROM R     -- Recurse until R = 0
          WHERE 0<>R
          )
SELECT CONCAT(A,'=(',B,'*',D,')+',R)R   -- Concat results into output string
FROM R
UNION ALL                               -- ALL required to maintain order
SELECT STR(B)                           -- Add final number
FROM R WHERE R=0

--Function Usage
SELECT * FROM E(447,501)

R
-----------------------------------------------------
501=(447*1)+54
447=(54*8)+15
54=(15*3)+9
15=(9*1)+6
9=(6*1)+3
6=(3*2)+0
3

Rev 1: Ruby, 86
Recursive algorithm, thanks to tip from Doorknob.
f=->i,j{j>i&&(i,j=j,i)
0<j ?(print i," = (#{j} * #{i/j}) + #{i%j}
";f[j,i%j]):puts(i)}

Rev 0: Ruby, 93
This really hasn't worked out well at all. The while loop takes up too many characters, especially with the end. I can't see a way of avoiding it. Recursion would require a named function instead of a lambda, which would also eat up a lot of characters.
->i,j{j>i&&(i,j=j,i)
while j>0
print(i," = (#{j} * #{i/j}) + #{i%j}\n")
i,j=j,i%j
end
puts i}

Call it like this:
f=->i,j{j>i&&(i,j=j,i)
while j>0
print(i," = (#{j} * #{i/j}) + #{i%j}\n")
i,j=j,i%j
end
puts i}

I=gets.to_i
J=gets.to_i

f.call(I,J)

You can use recursion via a=->i,j{...} and call a via a[1,2]—not sure if this would save you characters, though.

@Doorknob thanks for the tip, I wasn't aware of that syntax for calling lambda functions (see my use of f.call.) It is actually quite a bit shorter, but still a long way off Python.

PowerShell, 84
A recursive code block, stored in a variable. Invoke it with & $e num1 num2, e.g.:
$e={$s,$b=$args|Sort;if(!$s){$b}else{$r=$b%$s;"$b=($s*$(($b-$r)/$s))+$r";&$e $s $r}}

PS D:\> & $e 9894 2628
9894=(2628*3)+2010
2628=(2010*1)+618
2010=(618*3)+156
618=(156*3)+150
156=(150*1)+6
150=(6*25)+0
6

In a more readable form, it does the following (nb. for clearer code, I've put the full commandlet names, more spaces in the string, and made the pipeline output commands explicit):
function Euclid {
    $small, $big = $args|Sort-Object   #Sort argument list, assign to two vars.

    if (!$small) {                     #Recursion end, emit the last
        Write-Output $big              #number alone, for the last line.

    } else {                           #main recursive code

        $remainder = $big % $small
        Write-Output "$big = ( $small* $(($big-$remainder)/$small)) + $remainder"
        Euclid $small $remainder
    }
}

One annoyance from a codegolf point of view; PoSh has no integer division, 10/3  returns a Double, but cast the result to an integer and it doesn't always round down, it rounds N.5 to the nearest even number - up or down. So [int](99/2) == 50.
That leaves two awkward choices:
$remainder = $x % $y
$quotient = [Math]::Floor($x/$y)

# or, worse

$remainder=$null
$quotient = [Math]::DivRem($x, $y, [ref]$remainder)

Which is why I have to burn some characters doing:
$remainder = $big % $small
($big - $remainder)/$small

Apart from that, it's the number of $$$$ and the lack of ternary operator which really hurts.

I also have an iterative version which, rather nicely, is also 84 characters:
{$r=1;while($r){$s,$b=$args|Sort;$r=$b%$s;"$b=($s*$(($b-$r)/$s))+$r";$args=$s,$r}$s}

Completely anonymous codeblock, so run it with
& {*codeblock*} 1599 650

PHP, 118 Bytes
for(list(,$n,$m)=$argv,$g=max($n,$m),$l=min($n,$m);$g;$g=$l,$l=$m)
echo$g,$l?"=($l*".($g/$l^0).")+".($m=$g%$l)."
":"";

Try it online!
PHP, 131 Bytes
for(list(,$n,$m)=$argv,$r=[max($n,$m),min($n,$m)];$r[+$i];)echo$g=$r[+$i],($l=$r[++$i])?"=($l*".($g/$l^0).")+".($r[]=$g%$l)."
":"";

Try it online!
-4 Bytes replace list(,$n,$m)=$argv with [,$n,$m]=$argv needs PHP>=7.1

JavaScript (ES6), 74 50 62 61 55 bytes
f=(x,y)=>y?y>x?y:x+`=(${y}*${x/y|0})+${x%=y}
`+f(y,x):x

Sacrificed 12 bytes allowing the integers to be passed in any order, rather than largest first.

Try It

f=(x,y)=>y?y>x?y:x+`=(${y}*${x/y|0})+${x%=y}
`+f(y,x):x
o.innerText=f(i.value=683712533265363251376,j.value=18237983363879361)
i.oninput=j.oninput=_=>o.innerText=f(+i.value,+j.value)
<input id=i type=number><input id=j type=number><pre id=o>

Explanation
f=          :Assign the function to variable f ...
(x,y)=>     :And take the two integer inputs as arguments via parameters x and y.
y?          :If y is greater than 0 then
y>x?        :    If y is greater than x then
f(y,x)      :        Call f again, with the order of the integers reversed.
            :        (This can only happen the first time the function is called.)
:           :    Else
x           :        Start building the string, beginning with the value of x.
+`=(        :        Append "=(".
${y}        :          The value of y.
*           :          "*"
${x/y|0}    :          The floored value of x divided by y
)+          :          ")+"
${x%=y}     :          The remainder of x divided by y, which is assigned to x
            :          (x%=y is the same as x=x%y.)
\n          :          A newline (a literal newline is used in the solution).
`+f(y,x)    :        Append the value f returns when y and the new value of x
            :        are passed as arguments.
:           :Else
x           :    Return the current value of x,
            :    which will be the greatest common divisor of the original two integers.

Japt, 43 42 41 bytes
My newfound Japt "skills" seem to be getting worse, not better!
?U>V?ßVU :[V'='(U'*V/U|0')'+V%=UR,ßVU]¬:V

Try it online

JS, 151
a=prompt("g","");b=prompt("l","");c=0;l=[a,b];for(var i=0;i<=1;i++){t=c;o=c+1;r=c+2;n=l[t]%l[o];if(n!==0){l[r]=n;c=c+1;i=0;}else{p=l[o];alert(p);i=2;}}

C, 83 bytes
g(x,y,z){y&&(printf("%u=(%u*%u)+%u\n",x,y,x/y,z=x%y),z)?g(y,z,0):printf("%u\n",y);}

test and results
int main()
{g(18,27,0);
 g(50,20,0);
 g(447,501,0);
 g(9894,2628,0);
}

18=(27*0)+18
27=(18*1)+9
18=(9*2)+0
9
50=(20*2)+10
20=(10*2)+0
10
447=(501*0)+447
501=(447*1)+54
447=(54*8)+15
54=(15*3)+9
15=(9*1)+6
9=(6*1)+3
6=(3*2)+0
3
9894=(2628*3)+2010
2628=(2010*1)+618
2010=(618*3)+156
618=(156*3)+150
156=(150*1)+6
150=(6*25)+0
6

Java 133
public void z(int i,int j){for(int d=1;d!=0;i=j,j=d){d=i%j;System.out.println(i+"=("+j+"*"+((i-d)/j)+")+"+d);}System.out.println(i);}

It doesn't do the regular Euclidean algorithm. Instead, it uses modulus and then computes the 2nd number to multiply by when it's printed out. You can also make this shorter by turning it into a lambda expression, but I'm not sure how.
public void z(int i, int j)
{
    for(int d=1;d!=0;i=j,j=d)
    {
        d=i%j;
        System.out.println(i+"=("+j+"*"+((i-d)/j)+")+"+d);
    }
    System.out.println(i);
}

I know it's been over 1.5 years, but you can remove the public , change the second println to print, and change d!=0 to d>0. Also, it's currently giving an incorrect output for the first rows. This can be fixed by adding if(d!=i) in front of System.out.println(i+"=("+j+"*"+((i-d)/j)+")+"+d);. So in total: void z(int i,int j){for(int d=1;d>0;i=j,j=d){d=i%j;if(d!=i)System.out.println(i+"=("+j+"*"+((i-d)/j)+")+"+d);}System.out.print(i);} (131 bytes & bug-fixed)

C# 115
First time on this forum
int g(int a,int b){(a,b)=a<b?(b,a):(a,b);Console.Write($"{a}=({b}*{a/b})+{a%b}\n");return a%b==0?b:g(b,a%b);}

Please don't make more work for other people by vandalizing your posts. By posting on the Stack Exchange (SE) network, you've granted a non-revocable right, under the CC BY-SA 4.0 license for SE to distribute that content. By SE policy, any vandalism will be reverted. If you want to know more about deleting a post, consider taking a look at: How does deleting work?

05AB1E, 32 30 bytes
{R[D`‰«Â`"ÿ=(ÿ*ÿ)+ÿ",¤_#ιθ}1è,

Inputs as a pair [i,j]. Output is without spaces.
Try it online or verify all test cases.
The -10% bonus isn't worth it to output in the correct format, but here it is anyway:
48.6 bytes (54† bytes - 10% bonus)
† Should have been -1 byte by removing the §, but there is a bug with j and integer-lists.
{R[D`‰«¤_#¤UDιθ})øε§Zgj}øεR`"ÿ = (ÿ * ÿ) + ÿ"}Xª»„( Â:

Try it online or verify all test cases.
Explanation:
{               # Sort the (implicit) input-pair from lowest to highest
 R              # Reverse it from highest to lowest
[               # Start an infinite loop:
 D              #  Duplicate the current pair
  `             #  Pop one and push both values separated to the stack
   ‰            #  Divmod: a,b → [a//b,a%b]
    «           #  Merge the pairs together: [a,b,a//b,a%b]
 Â              #  Bifurcate this quadruplet; short for Duplicate & Reverse copy
  `             #  Pop and push the reversed items separated to the stack
   "ÿ=(ÿ*ÿ)+ÿ"  #  Push this string, where the `ÿ` are one by one filled with the values
              , #  Pop and output it with trailing newline
 ¤              #  Push the last value (`a%b`), without popping
  _             #  If this is 0:
   #            #   Stop the infinite loop
                #  (else)
 ι              #   Uninterleave it into two parts: [a,b,a//b,a%b] → [[a,a//b],[b,a%b]]
  θ             #   Pop and keep the last pair (`[b,a%b]`)
}               # After the infinite loop:
 1è             # Pop the final quadruplet, and leave its second item: `b`
   ,            # Pop and output it with trailing newline as well

{R[D`‰«         # Similar as above
¤_#             #  Similar as above as well
   ¤            #  Push the last item without popping again
    U           #  Pop and store it in variable `X`
     D          #  Duplicate the quadruplet
      ιθ}       #  Similar as above as well
)               # Wrap the quadruplets of the stack into a list
 ø              # Zip/transpose; swapping rows/columns
  ε             # Map over each inner list
   §            #  Cast every integer to a string (†bug work-around for builtin `j`)
   Z            #  Push the largest integer, without popping
    g           #  Pop and push its length
     j          #  Potentially add leading spaces so all values in the list are of this length
  }ø            # After the map: zip/transpose back
 ε              # Map over each inner list:
  R`            #  Push the items in reverse order to the stack
    "ÿ = (ÿ * ÿ) + ÿ"
                #  Push this string, where the `ÿ` are one by one filled with the values
 }Xª            # After the map: append value `X`
    »           # Join this list by newlines
     „(         # Push string "( "
       Â        # Bifurcate; short for Duplicate & Reverse copy: " ("
        :       # Infinitely replace "( " to " ("
                # (after which the string is output implicitly as result)