text:
Four weights to produce integer scale differences from 0 through 40 pounds
Just-in-time edit: I decided to reveal part of the answer and highlight a single aspect of the challenge.

Show how 4 weights, of 1, 3,  9, and 27 lbs. can be used to produce "weight differences" from 0 to 40 lbs.
You have a two - pan balance scale.
We define the difference in pan weights as the total weight placed on the left pan minus the total weight on the right pan.
The difference in pan weights for the empty scale is 0 lbs.
You have 4 rocks, a,b,c, and d, weighing 1, 3, 9 and 27 lbs respectively
Show how you can produce all integer weight differences from 0 to 40 lbs.
Simpler example:
Problem: With weights of 1 and 3 lbs. show how you can generate all weight differences from 0 to 4 lbs.
Output: for a=1, b=3;

For the 4 weight, 40 pound version, your output should consist of
a table with columns displaying the weight difference, the symbolic amounts in each pan, and the absolute weights in each pan.
You may format the table in a way congenial to the language you are coding in.
Scoring: Shortest code wins
Bonus: 50% of your score if the same code can present the results for the case where 3, 4, and 5 weights are used (for 13, 40, and 121 lbs.)

The thing I (with my moderator cap taken off) don't like about this is that there is only one correct solution (1,3,9,27) as opposed the correct output depending on some input. The bonus is a nod in the right direction, but.. Can it be generalized? That would make a better task, IMO.

@dmckee I decided to reveal the weights and focus on the table.

u[x_] := (b = Array[n, x];
Table[FindInstance[b.Array[3^#/3 &, x] == s && b.b <= x, b,
Integers], {s, 0, (3^x 3 - 1)/6}]);
u[4]

@belisarius Nice, and elegant. Why don't you submit it as an answer?  [If you can spare the bytes, You might want to wrap the output in MatrixForm. for legibility.]

@dmckee Thanks for your input. Next time I'm developing a question, I'll first submit it to Meta for comments.

@DavidCarraher in 68 bytes Function[u,TableForm@SortBy[Tuples[{0,1,-1},u],#.Array[3^#/3&,u]&]][4]

Python 124 107 bytes * 50% = 53.5
f=lambda i,e=1:i and[e]*(i%3>1)+f(-~i/3,e*3)or[]
for i in range(3**4/2+1):r=f(-i),f(i);print i,map(sum,r),r

For different numbers of stones, replace the 4 in range(3**4/2+1) with any positive integer.
Sample output:
0 [0, 0] ([], [])
1 [1, 0] ([1], [])
2 [3, 1] ([3], [1])
3 [3, 0] ([3], [])
4 [4, 0] ([1, 3], [])
5 [9, 4] ([9], [1, 3])
6 [9, 3] ([9], [3])
7 [10, 3] ([1, 9], [3])
8 [9, 1] ([9], [1])
9 [9, 0] ([9], [])
10 [10, 0] ([1, 9], [])
11 [12, 1] ([3, 9], [1])
12 [12, 0] ([3, 9], [])
13 [13, 0] ([1, 3, 9], [])
14 [27, 13] ([27], [1, 3, 9])
15 [27, 12] ([27], [3, 9])
16 [28, 12] ([1, 27], [3, 9])
17 [27, 10] ([27], [1, 9])
18 [27, 9] ([27], [9])
19 [28, 9] ([1, 27], [9])
20 [30, 10] ([3, 27], [1, 9])
21 [30, 9] ([3, 27], [9])
22 [31, 9] ([1, 3, 27], [9])
23 [27, 4] ([27], [1, 3])
24 [27, 3] ([27], [3])
25 [28, 3] ([1, 27], [3])
26 [27, 1] ([27], [1])
27 [27, 0] ([27], [])
28 [28, 0] ([1, 27], [])
29 [30, 1] ([3, 27], [1])
30 [30, 0] ([3, 27], [])
31 [31, 0] ([1, 3, 27], [])
32 [36, 4] ([9, 27], [1, 3])
33 [36, 3] ([9, 27], [3])
34 [37, 3] ([1, 9, 27], [3])
35 [36, 1] ([9, 27], [1])
36 [36, 0] ([9, 27], [])
37 [37, 0] ([1, 9, 27], [])
38 [39, 1] ([3, 9, 27], [1])
39 [39, 0] ([3, 9, 27], [])
40 [40, 0] ([1, 3, 9, 27], [])

The basic operating principle, is that the problem is analog to converting a number into ternary. In Python, this is a one liner:
f=lambda i:i and i%3+f(i/3)*10

Of course, we're working in a slightly different base. Instead of the values 0, 1, 2 we use -1, 0, 1. This means when i%3 == 2, this should really be -1 (calculated by (i+1)%3-1 or -~i%3-1), and the value of the i sent to the next iteration needs to be adjusted accordingly.
More specifically, if d=(i+1)%3-1, then the value of i sent to the next iteration should be (i-d)/3. However, this calculaion can be simplified greatly using integer division, to just (i+1)//3. Rationale: if d == 0, then i was already a multiple of 3, and adding one won't change the integer quotient. If d == 1, then we should be subtracting 1 to make i a multiple of 3, but if we add 1 instead, it will now be 2 (mod 3), which won't change the integer quotient either. If however d == -1, then we do in fact need to add 1 to reach the next multiple of 3. Therefore, by using integer division, all three cases can be simplified to adding 1.
One thing that makes this problem interesting is that the negative and positive values need to be separated into different baskets. I decided the best way to accomplish this is to only collect the positive values, and then call the function again with -i, which will obviously have its stones reversed. This also allows me to save the -~i%3 calculation entirely, since I know what its value will be.

Nice explanation.

APL 198 * 50% = 99
z←W n
l←⍉(n⍴3)⊤w←0,⍳+/b←3*0,⍳n-1
r←(⍴l)⍴0
:while 0≠+/+/l>1
    r←r+l>1
    l←((l≤1)×l)+1⌽l>1
:end
a←' ',⌽⎕av[97+⍳n]
c←(⍴l)⍴⍳n
b←0,⌽b
z←l≠r
l←z×l
r←z×r
l←1+l×c
r←1+r×c
z←w,'{',a[l],'}','{',a[r],'}','{',b[l],'}','{',b[r],'}'

As we are effectively working in base three the arithmetic is fairly trivial and is complete by the end of the while loop where the arrays l and r are the contents of the left and right scale pans respectively in base three. This takes about 80 characters. The rest is formatting the output which I am sure can be improved.
To run simply type W followed by the number of weights you want to use. Below is a sample output for n=3:
 W 3
 0 {   }{   }{ 0 0 0 }{ 0 0 0 }
 1 {  a}{   }{ 0 0 1 }{ 0 0 0 }
 2 { b }{  a}{ 0 3 0 }{ 0 0 1 }
 3 { b }{   }{ 0 3 0 }{ 0 0 0 }
 4 { ba}{   }{ 0 3 1 }{ 0 0 0 }
 5 {c  }{ ba}{ 9 0 0 }{ 0 3 1 }
 6 {c  }{ b }{ 9 0 0 }{ 0 3 0 }
 7 {c a}{ b }{ 9 0 1 }{ 0 3 0 }
 8 {c  }{  a}{ 9 0 0 }{ 0 0 1 }
 9 {c  }{   }{ 9 0 0 }{ 0 0 0 }
10 {c a}{   }{ 9 0 1 }{ 0 0 0 }
11 {cb }{  a}{ 9 3 0 }{ 0 0 1 }
12 {cb }{   }{ 9 3 0 }{ 0 0 0 }
13 {cba}{   }{ 9 3 1 }{ 0 0 0 }

I like the two-pan output.

Why are you doing things like l×l=0? That always evaluates to 0. if l=0, it's 0×1, which is 0; if l≠0, it's l×0, which is also 0. (Or you're using a weird APL).

Thanks @marinus - Old age?! Unfortunately there is still a problem with the table which can be seen on the 8 line. I will have another look.

I have corrected problem whereby the same weight could occur on both sides of the scales e.g. 8 was being shown as {9 3 0}{0 3 1}

@Graham You forgot to update the corresponding abc pans. For 8, it still shows {cb }{ ba}.

@primo - thanks. Old age again I am afraid. I did not post the new output simply tried and failed to edit what was there! As you can see in the code the same indices, [l] [r], are used for the letters and numbers.

Python, 160 * 50% = 80
def f(n):
 for i in range(3**n/2+1):g=lambda z:'+'.join(`3**x`for x in range(n)if(i+3**x/2)/3**x%3==z)or'0';print i,'[%s, %s]'%(g(1),g(2)),map(eval,(g(1),g(2)))

Shows how each weight difference can be produced, given 'n' different weights.

Perl, 201 (or 166) chars + 50% bonus = 100.5 (or 83)
eek, brute forcing this turned out to be more complex than i anticipated. im interested to see others' certainly more analytical approaches
change the problem size by modifying the value of $j defined at the top to 3, 4, or 5.
this will demonstrate all ways to generate the differences, not any pairs in particular.
some additional characters are used to print the differences in order. otherwise, you can remove the outer for$n(0..$s){} loop and the $$x[$j]-$$_[$j]==$n test to save 14+21 chars for a total of 166 chars.
$k=($j=4)-1;@a=map{$s=0;$s+=$_ for@$_;[@$_,$s]}map{$c=$_;[map{$c&1<<$_&&3**$_}0..$k]}0..2**$j-1;for$n(0..$s){for$x(@a){$$x[$j]-$$_[$j]==$n&&print"$n {@$x[0..$k],@$_[0..$k]} {$$x[$j],$$_[$j]}",$/for@a}}

or slightly more formatted (no more readable):
# set $j to the problem domain size
$k = ($j = 4) - 1;

# gather up all possible combinations and their sums
@a = map{ $s=0; $s+=$_ for @$_; [@$_,$s] } map { $c=$_; [map { $c & 1<<$_ && 3**$_ } 0..$k] } 0 .. 2**$j-1;

# walk through the pairs of combinations and find the differences
for $n (0..$s)
{
  for $x (@a)
  {
    $$x[$j] - $$_[$j] == $n &&
      print "$n {@$x[0..$k],@$_[0..$k]} {$$x[$j],$$_[$j]}", $/ for @a
  }
}

Would you show a few lines of the output?

@DavidCarraher it produces this output: http://codepad.org/NCf1KIMN

Perhaps I didn't make it clear: there are only 4 stones, so you cannot use the same stone on both sides of the two-pan balance scale.  This constraint leaves only one way to solve each weight difference.


text:
10 PRINT CHR$(205.5+RND(1)); : GOTO 10 in PHP (or anything else, for that matter)
Just had a 'spirited' conversation with a co-worker about the succinctness of the following BASIC statement:
10 PRINT CHR$(205.5+RND(1)); : GOTO 10

It's the title of this book, and will simply print a sequence of / and \ characters, alternating between the two randomly, resulting in a pattern similar to this:

(Image borrowed from http://www.flickr.com/photos/rndmcnlly/5058442151/sizes/o/in/photostream/)
Being of a PHP proclivity, we wondered what the most compact way of writing the same thing in PHP would be, and came up with this:
while(1) { echo chr(47 + 45 * rand(0,1)); }

chr(47) is a / character, and chr(92) is a \. So the statement echo chr(47 + 45 * rand(0,1)); will randomly alternate between the two, ad nauseam.
In a language of your choosing, write the shortest program or function to output an infinite random sequence of \ and / characters, where each character has an equal probability of being chosen.

You can lose the {} braces, but that's about as concise as you can make it.

This is cool. What font can be used to get a similar image?

This (picture) reminds me of the first "program" I ever wrote on my commodore 64 straight out of the manual :) ah happy days

@daniero I think the actual typeface is called Terminal, but I found it online as "Windows Command Prompt" https://codepen.io/nickforddesign/pen/WMqQdM?editors=0110

What a strange coincidence that this Code Golf repo on Github happens to have the exact same challenge... https://github.com/noops-challenge/golfbot

It's a general pro tip: for(;;) is always shorter than a while

The goto operator was added to PHP from version 5.3.0 so you could use the same method as you would in BASIC:
a: echo chr(47 + 45 * rand(0,1)); goto a;

Since this has been migrated to codegolf...
PHP 30 bytes
<?for(;;)echo rand(0,1)?~Ð:~£;

The Ð is character 208, and the £ is character 163.
Sample usage (on a Windows box):
color 18 & php maze.php

Produces something similar to:

It works best with a monospace font that is exactly square (here I've chosen the standard system font 8x8). To go back to your default color, you can type color again without any parameters.

Can save an extra byte with rand()%2 (nobody stated how pseudo-random it had to be) - Also doesn't work on Unicode terminals (like OSX)

@Leigh Due to its implementation, rand()%2 will alternate between zero and one. mt_rand()%2 would work, however.

Ðis is really nice. Bring back þorn!

Mathematica 157 bytes
Lacking PETSCII, I rolled my own "\" and "/".
No cigar for brevity here.
Graphics[{Thickness[.005],RGBColor[0.73,0.55,1.],Line/@Flatten[Table[RandomChoice[{{{x,y},{x+1,y+1}},{{x+1,y},{x,y+1}}}],{x,40},{y,25}],1]},Background->Blue]

This image does the grey dot optical illusion!!

Brainfuck - 534
>+[->>>>>>[<<<<<<+>>>>>>-]>[<<<<<<+>>>>>>-]<<<<+++++++[<+++++++++++>-]
<[<<[>>>>>>+<<<+<<<-]>>>[<<<+>>>-]<<[>>>>>+<<<+>+<<<-]>>>[<<<+>>>-]<[>
>>>+[<<<+>+>>-]<<[>>+<<-]+<[>-<[-]]>[>+<-]<<-]<-]++++++[>++++++++<-]>-
[<<[>>>>>+<<<<+<-]>[<+>-]>-]<<<[-]>[-]+++++[<+++++>-]<[>>>>>>>+[<<<<<<
+>+>>>>>-]<<<<<[>>>>>+<<<<<-]+<[>-<[-]]>[>>>>+<<<<-]<<-]++++++[>>>>>>+
++++++++<<<<<<-]>>>>>>[<<<<<<<+>+>>>>>>-]<<<<<<[>>>>>>+<<<<<<-]++<[->-
[>+>>]>[+[-<+>]>+>>]<<<<<]>[-]>>[-]<[<<+>+>-]<<[>>+<<-]+>>[-]<[++++[>+
+++<---]>.[-]<<->]<[[>+<+++++]>----.[-]<]>+]

My prng (from here) is both large and extremely slow. Perhaps a simpler LFSR or similar would suffice, but this works:

I think this is not random, though, since this is brainfuck.

most of these are relying on built-in prngs. Yeah, this will output the same every time. Could allow it to be seeded from keyboard at cost of a couple extra chars, but thats not really the point here, I think.

Befunge, 12 9 8 7 Bytes
Edit: James Holderness figured out an insane solution that uses three quotes instead.
?\","/"

Overflows the stack with a lot of excess characters for each symbol, but who cares when you can golf that 1 byte?
Old version
"/\"?>,#

(Note the trailing space) Trailing space apparently not needed (thanks MercyBeaucou)
Try It Online
"/\" Adds both / and \ to the stack
    ? Chooses a random direction to go in. Both up and down loop back around to the ? so it's 50% chance to go in either direction.
Going left
"/\"  >,#  Adds \ and / to the stack but only print the second, the / before heading back
Going right
      >,# Prints the top of the stack, the \ before heading back

This does start to fill up the stack, with one extra symbol for every symbol printed.

looks like you can get rid of the extra space, as the # is at the end of a line. It's not consistent behavior, but the interpreter you're using allows it: https://tio.run/##S0pNK81LT/3/X0k/RsneTkf5/38A

I also wonder if you are able to use only one ", but my attempts have been futile. Because you need a / on one side of the ", you will have to divide half the time.

@MistahFiggins Space definitely shouldn't be required for any standard Befunge-93 implementation. The code may fail in some Funge-98 interpreters, where the spec is more ambiguous, but adding a space wouldn't help in those cases anyway - you'd need a < after the # to make it work.

@MistahFiggins As for getting rid of one of the quotes, you can kind of do that in Befunge-98 by using ' instead. Try it online!

@MistahFiggins I managed to get to 11 bytes using only one ". ? #,\"1/,#1 The problem lies with having to use 2 prints

@JoKing Just realised you can actually do better with three quotes! ?\","/" Only downside it it'll overflow the stack much faster I think.

@JamesHolderness wow! I had gotten really close by using a high value instead of \  so that it would divide to be \ , but I hadn’t thought about using 3. Genius.

C, 39 chars (38 on MSVC)
main(){while(putchar(rand()%2?47:92));}

See it run.
On MSVC, we can replace putchar() with _putch() and save a byte, but it doesn't work in IDEOne.
main(){while(_putch(rand()%2?47:92));}

Common Lisp, 33
(loop(princ(elt"/\\"(random 2))))

Jelly, 5 bytes
Ø^XȮß

Try it online!
XØ^ß is a byte shorter, but prints a 0 before the slashes.
  X      Choose a random element from
Ø^       "/\",
   Ȯ     print it,
    ß    then call this link again.

I forgot ß can loop infinitely -_-

Python 3, 59 51 bytes
Using only 1 line (in the spirit of the original 10 PRINT):
from random import*;exec("while 1:print(end=choice('\/'))")
while 1:from random import*;print(end=choice('\/'))

Or (possibly not that random) using hash for just 47 bytes (but on 2 lines):
x=0
while 1:x=hash(str(x));print(end='\/'[x%2])

Try it online!

Welcome to Code Golf! Nice first answer.

It's 52 bytes by using __import__ (still on one line)

@Steffan Great improvement! Also helps slow it down to something more like the original :)

Here's a 46-byte version of your hash solution that's back to being a one-liner. :)

@DLosc Brilliant!!! Of course now I'm going to spend far to much time trying to shave another byte off ;)

print has a return value of 1, so if you use that you can just wrap the whole expression in the while:
while(print chr(47 + 45 * rand(0,1));
You can probably golf it further too.

Vyxal, 5 bytes
{k/℅₴

No trying it online
It was a smart choice adding all of the two byte constants of 05ab1e and Jelly.

C (gcc), 47 bytes
main(){while(putchar(47+45*(rand()/(1<<30))));}

Try it online!

38 bytes: main(){main(putchar(rand()%2?92:47));}

Very nice! I have lots to learn golfing c, recursive main seems to be quite handy and rand mod 2 puts my monstrosity to shame!

i try create using css style, and it's work

this php code :
<?php
  $i=10000;
  while($i) {
    if($i%200 == 0) echo '
';
    echo chr(47 + 45 * rand(0,1));
    $i--;
  }
?>

I'd like to suggest an alternative style: font-family: courier; line-height: 0.75em; letter-spacing: -0.25em; Using -0.25em for letter-spacing seems to match up better than -3px, which has artifacts due to an inexact pt to px conversion.

ruby, 27 23 chars
loop{$><<"/\\"[rand 2]}

$><< is 'print to stdout'.

You should be able to replace "/\\" with '\/'. Ruby 1.8 requires [rand(2),1] to produce the character instead of the ascii code.

C++, 45 Chars
int main(){for(;;)cout<<(rand()%2?"/":"\\");}

Not going to win any awards for shortness, but I had already written this when I heard about the mentioned book, so I just golfed it.
The putchar trick also works in C++, getting you down to 43, but you can't avoid declaring the return type on main.

Common Lisp - 68
(defun s(l)(elt l(random(length l))))(loop do(format t"~a"(s"/\\")))

Loop allows both a complex and a simple syntax, the simple one being like a progn, but looping forever. You can drop the do.

Python, 68
In the "my language sucks at this" category, we've got Python!
import random,sys
while 1:sys.stdout.write(random.choice('/\\'))

Thanks to Ivo for a few chars on imports and choice.

Well, you're not saving anything with 'from sys import*' - if you instead write 'import sys,random' and use sys.stdout and random.random, you'll save 5 bytes.

Python3:
import random
while 1:print(random.choice('/\'),end='')

@Ivo, Thanks, I forgot about choice!  You can keep py3, though.  ;)

If you reverse your string, you do not have to escape the backslash, thus saving a byte.

16-bit x86 assembly code, 10 bytes
I don't remember if this one ended up in the book.
init:
scasb            ;read from where ES:DI points and compare to AL
                 ;this sets flags similar to a subtraction
salc             ;set mask in AL to 00 or FF
and   al,'\'-'/' ;begin choosing character (AL is 00 or 2D)
add   al,'/'     ;finish choosing character
writec:
int   29h        ;write char in AL
jmp   init       ;loop endlessly

PHP, 26 31 bytes
eight three bytes shorter than yours (without whitespace or braces),
two bytes shorter than primo´s solution (without the tag).
PHP 5.4.9 was the current version in December 1012, so ...
for($s="\/";;)echo$s[rand()%2];

requires PHP 5.5 or later for literal string indexing.
Run with -r or try it online.

PHP 5.5 didn't exist at the time of the challange posting, but have a +1 anyway. Also, try rand()&1 on a PHP build for Windows. You might be surprised.

05AB1E, 7 bytes
["/\"Ω?

Try it online!
["/\"Ω?  - Full program
[          Start an infinite loop
 "/\"      ... Push the string "/\" on the stack
     Ω     ... Pick a character from the top of the stack, at random
      ?    ... Print without a newline

[„/\Ω? is better

Befunge-98 (PyFunge), 7 bytes
? '/,\'

Try it online!
the ? sends the IP either left or right, so either / or \ is pushed before printing with ,. When executing the '/ or \' in the wrong order after printing, it just does things to the stack (divides or swaps), and then pushes an irrelevant character before repeating.

I was just proposing a different 7 byte Befunge-98 solution on Jo King's answer. But this approach looks neater.

Keg, 12 bytes
You do not have to worry about the evenness 0f the output, because the range is 0 to 32767, and 32767+1 = 32768; it is an even number.
{~2%[\\|\/],

HTML+JS, 186

this.innerHTML+='/\\'[2*Math.random()|0])">C l i c k   m e !

Uiua, 15 bytes
⍢(&pf⊡⁅⚂"\\/")1

This goes in an infinite loop, so to try this without having your browser hang, first go to the Uiua pad, click the settings icon, and change "Exec limit" to a low  number like 0.5 seconds. Then paste this code in and click Run.
Explanation: ⊡⁅⚂"\\/" gets a random number between 0 and 1, rounds it to the nearest integer, and picks either \ or / based on that. &pf prints that character without a newline. ⍢(…)1 is do … while 1.
I've found a couple other 15 byte solutions:

⍢(&pf⊡⁅⚂.)1$ \/ — You save a byte by using a raw string literal and dropping the extra backslash, but you have to define it outside of the loop, and use an extra byte to duplicate it each iteration, so it's not shorter.
⍢(&pf+×45⁅⚂@/)1 — Multiply 45 by random 0/1, add that to /.

Not much better. Needs php 5.5+ for the array dereferencing feature.
while(1) { echo ['/', '\\'][rand(0, 1)]; }

Never even thought of that, thanks!

Actually PHP supports subscripts for strings: while(1)echo'/\\'[rand(0,1)];.

it means the for version would be the same length than the current shortest PHP answer: for(;;)echo'/\\'[rand(0,1)];

Java 8, 60 59 54 53 bytes
v->{for(;;)System.out.write(Math.random()<.5?47:92);}

-1 byte thanks to @BenjaminUrquhart by replacing print with write, so '/' can be 47.
Explanation:
Try it online (times out after 60 sec).
v->{                     // Method with empty unused parameter and no return-type
  for(;;)                //  Loop indefinitely
    System.out.write(    //   Print:
      Math.random()<.5?  //    If the random decimal value in range [0,1) is below 0.5:
       47                //     Print forward slash
      :                  //    Else:
       92);}             //     Print backward slash

Java. 60. Bytes. Wow.

@EriktheGolfer Hehe. I hadn't even noticed I'm about average in byte-count. Usually I'm just assuming Java is one of the highest byte-counts, only slightly competeable with BrainFuck or C# sometimes. xD (PS: I even golfed it to 59 :P)

You are not average, you have a too small byte count (assuming Java, not that too small isn't good). But, at least, this isn't JAVA 8, where I think it's longer...

@EriktheGolfer Hmm, isn't Java 8 shorter with c->{for(;;)System.out.print(Math.random()<.5?'/':92);} (54 bytes) Or did you mean Java 7 is longer than Java 8? In that case you are indeed correct.

Dunno, I said that, usually, Java 8 is longer, because I have experienced seeing such bytecounts. Fr though, I haven't been able to take a Java tutorial for anything, because it simply does not work.

53 bytes by switching to System.out.write and replacing '/' with 47

@BenjaminUrquhart Thanks! Need to remember that write when printing characters. o.Ô

><>, 14 bytes
I was hoping I could restrict it to a 3*3 square but didn't succeed.
"/\
~x/
o</
 !

You can try it here.

Cubix, 12 bytes
D<^<!"/\"B!o

View in the online interpreter!
This maps out to the following cube net:
    D <
    ^ <
! " / \ " B ! o
. . . . . . . .
    . .
    . .

Explanation
Setup:
The IP begins heading east at the first !. This is the 'skip if truthy' command, which is False when there is nothing on stack, so no commands are skipped. "/\" enters stringmode and appends these two character codes to the stack. B!o is mostly a no-op here, only reversing the stack.
The IP now loops back around to the first !. However, there are now positive integers on stack, so the first " is skipped. This means / is no longer a character, but a mirror, sending the IP north into the main loop.
Main Loop:
The D command is the only source of randomness in Cubix. It sends the IP in a random direction. By blocking off South and East with arrows, we make sure the IP has a 50% chance of heading North, and a 50% chance of heading West.
If it heads West, the stack is reversed. If it heads North, the top character is printed.
This creates the random sequence of slashes, as desired.

SmileBASIC, 20 bytes
?"/\"[RND(2)];
EXEC.

JavaScript (Node.js), 59 55 54 bytes
Original Answer
while(1){process.stdout.write(Math.random()>=0.5?"/":"\\")}

-4 bytes thanks to manatwork
while(1)process.stdout.write(Math.random()<.5?"/":"\\")

-1 byte thanks to Conor O'Brien
for(;;)process.stdout.write(Math.random()<.5?"/":"\\")

Welcome to the site!

No need for braces around a single instruction block; in JavaScript the 0 integer part can be left out; reverse the conditional to use single character operator: while(1)process.stdout.write(Math.random()<.5?"/":"\\").

@manatwork Thanks! Updated.

You can also write for(;;) instead of while(1)

Thank you as well. Added.

PowerShell, 108 90 86 54 53 37 36 bytes
for(){Write-Host "\/"[(Random 2)]-n}

Try it online!

Welcome to Code Golf. Tips for golfing in PowerShell

The Get verb is implied + don't always need to provide the full name of a parameter, and some parameters are positional

for also makes while a bit shorter

you can more... more precisely, less :)

and less

Cubix, 10 bytes
Du\'^>o$/;

Watch it run
    D u
    \ '
^ > o $ / ; . .
. . . . . . . .
    . .
    . .

Was an interesting one to do as i haven't played with the random direction generator much.

^D redirect to the random direction pointer

Directed north

o\> loops around the cube, print empty stack and redirecting back into the print commands (stack is empty)

Directed west

^ redirected back into the random direction pointer

Directed south

\'/> reflected to the east, push / onto the stack and redirect into the print commands

Directed east

u'\> uturn to the right, push \ onto the stack and redirect into the print commands

Print commands

o$/;^ output top of stack, skip over the reflect, pop from the stack and redirect into the random direction pointer

Python, 61 bytes
from random import*
while 1:print('/\\'[randint(0,1)],end='')

Pretty self explanatory. Had to use the double backslash since backslashes are escape characters in Python.
Try it Online!

R, 33
Just interested to see whether this can be made smaller.
while(1)cat(sample(c('/','\\'),1))

BRASCA, 13 12 bytes
1[`/\`1?#$o]

Try it online!
Explanation
1[         ]  - While 1:
  `/\`       -   Push \ and /
      1?      -   Push rand(0,1)
        #$    -   If truthy, swap the top two items, else skip.
          o   -   Print it!

Add++, 19 bytes
D,f,,"\/"BX
Dx,$f,o

Try it online!
How it works
D,f,,    ; Define a function, f
    "\/" ; Push "\/"
    BX   ; Random choice

Dx,      ; Do, while x:
   $f,   ; Set x to the result of f
   o     ; Output with no newline

Python 3, 52 51 bytes
from random import*
while 1:print(end=choice('\/'))

Try it online!
Saves at least 9 bytes over other python solutions here.
Edit: saved a byte via ayreguitar's comment

Nice use of end! But as @Jonathan Frech pointed out in the first Python entry, no need to escape the \ if you reverse the order, saving 1 byte: while 1:print(end=choice('\/'))

I guess you can use recursion.
function slashes() {echo chr(47 + 45 * rand(0,1)); slashes();}

I guess you can use recursion.
function slashes() {echo chr(47 + 45 * rand(0,1)); slashes();}

...

stack space is not infinite.

@codaddict so it will timeout.

Assuming a considerably high timeout your snippet is not equivalent to the OP's.

@codaddict lol the OPs times out as well. it is an infinite loop!

Yours would create a run time error before the timeout.

@codaddict no errors, just a timeout: http://codepad.org/nR6IunfF

http://ideone.com/euCb5Z here you go SIGSEGV

chopped off one character:
while(1) { echo chr(2 + 45 * rand(1,2)); }

then remove the curly braces:
while(1) echo chr(2+45*rand(1,2));

another trick, with the same length:
while(1) echo chr(rand()%2*45+47);

Due to the algorithm it employs, rand()%2 will result in an alternation of 0s and 1s. Not incredibly random. You'd need to use rand(0,1) or mt_rand()%2 instead.

Perl
This one looks funny for me :
perl -pe '$_="~"ge$_?"/":"\\"' </dev/urandom

(Sorry to be out of subject here. I know this is not PHP)

Powershell, 37 bytes
for(){Write-Host(Random("\","/"))-N}

unfortunately there seem to be no shorter aliases for Write-Host that don't cause a new line after every char.

Fission, 12 bytes
[#"\"R
W\"/"

Try it online!

Tcl, 53 bytes
while 1 {puts -nonewline [expr rand()<.5?"/":"\\\\"]}

Try it online!

Pyth - 12 9 bytes
#@,\/\\O2

Tested without loop code because the online interpreter dislikes infinite loops
Explanation:
#@,\/\\O2
#             Repeat until Error
 @            Implicitly print item number
       O2     random number between zero and two exclusive
  ,           of two item list containing
   \/         One character string /
     \\       One character string \

Perl 6, 23 bytes
loop {<\ />.pick.print}

loop loops forever.
<\ /> is a list of the strings \ and /.
.pick picks one of the two strings randomly.
.print prints that random string.

instead of loop, you can use xx*

Add++, 24 bytes
+1
W,R2,-1,*45,+47,H,x:1

Try it online!

q/kdb+, 18 bytes
Solution:
while[1;1"\\/"1?2]

Explanation:
A simple while(true) loop...
while[1;1"\\/"1?2] / the solution
while[1;         ] / while true do ...
              1?2  / 1 choose 2 (0 or 1)
         "\\/"     / string \/, index in at 0 or 1
        1          / print to stdout without newline

Extras:
Another 18 byte solution: {1"\\/"1?2}\[::;1]

Yabasic, 27 bytes
-1 byte thanks to @ayreguitar
Mid$("\/",...) is  used over Chr$() as the character codes for / and \ are 47 and 92, respectively.
While the GoTo structure of the original could easily be used for this yabasic answer, Do...Loop ends up being shorter due to the the structure of the Mid$ call.
Do?Mid$("\/",Ran(3),1);Loop

Try it online!

I don't know Yabasic, but from the TIO link you can save a byte by using "/" instead of "/\", like you can in Python (and I guess this works in some other languages)

Japt, 9 bytes
iOo"/\\"ö

Try it

MathGolf, 8 bytes
1Æû\/wq∟

Try it online!
Explanation
1          push 1
 Æ     ∟   do-while-true without popping using 5 operators
  û\/      push "\/"
     w     random char from string
      q    print without newline

Implicit popping doesn't seem to be working as intended when using do-while-true, or any other loop type. With this working correctly, the first 1 could be removed.
For a "working" 7-byter, you could do t{û\/wq, which replaces the do-while-true with a simple for loop, and begins the script by pushing the current timestamp in milliseconds to the stack. Currently, that means about \$1.56*10^{12}\$ iterations, which is "infinite" for most applications. However, this is not a valid answer, so the official answer is still 8 bytes.

APL (Dyalog Unicode), 12 bytes
→≢⍞←'/\'[?2]

Try it online!
Tradfn body that prints indefinitely.
Thanks to @Adám for 5 bytes, and for pointing out that, with a little bit of CSS magic, TIO can print the actual pattern like in the image.
How:
→≢⍞←'/\'[?2] ⍝ Tradfn body
         ?2  ⍝ Roll (randomly select) an integer between 1 and 2
        [  ] ⍝ Use the result to index...
    '/\'     ⍝ ...the string containing the two slashes
  ⍞←         ⍝ Print it to the same line
 ≢           ⍝ Tally the result (yields 1)
→            ⍝ then 'goto' that line

This is eligible for 200 rep, no?

@Adám is it? I've no idea why it would.

This.

Oh, I see. I guess it is, then? There were no answers in any APL flavour before mine, and it meets all the conditions in the post. I'll add my request to it.

Cool, and feel free to dig up any of your posts from since February. I have way too much rep.

Runic Enchantments, 13 bytes
`/-R`A*+k$!;

Try it online!
Slightly ungolfed for readability, with spaces to separate operational segments:
'/  2'RA  '- *+k $ !;

The difference of 45 is encoded in the - char literal, as chars are implicitly converted to integers when fed into a operator expecting a number value.
2'RA randomly generates a 0 or a 1, multiplied against the - and added to the / char resulting in either / or \, which is then printed after being coerced back to a char from an int. In the golfed version the  (0x02) serves as the 2.
Then the program loops forever by skipping the terminator, !;.

><>, 12 bytes
x!\"/!
^o< <

Try it online!
The idea here is to use x in combination with the ^ below to both loop and choose a random horizontal direction. If the IP goes left from the x, it will skip the mirror / and quote the string "\!x!/", reflect upwards with \, wrapping around to the <, which redirects the IP to output the result and begin the loop again. If the IP goes right from the x, a similar thing will happen.
This is all thanks to the nice happenstance that / and \ are control flow modifiers in ><>, allowing us to save a ".
An alternative solution for 13 bytes is slightly more generic and generates a lot fewer side effects.
xa!o"/\"o!a
^

(You can replace the as with spaces; I have them placed here for clarity. In production code, you would want to do this replacement to avoid unnecessary stack population.)

Clojure, 34 bytes
(loop[](pr(rand-nth"\\/"))(recur))

Zsh, 42 bytes
for ((;;))printf ${(#)$((RANDOM%2?47:92))}

try it online

AppleSoft BASIC, 33 bytes
33 bytes, verified here
1?MID$("\/",RND(1)+1.5,1);:GOTO1

35 bytes, using CHR$ conversion similar to C64.
1?chr$(47+45*int(2*rnd(1)));:goto1

Factor + qw, 33 bytes
[ qw{ / \ } random write t ] loop

Try it online!

Python, 66 bytes
import random
while 1:print(chr(47+random.randint(0,1)*45),end='')

Try it online!
Ungolfed:
import random
while True:
    slash_calc = 47 + random.randint(0, 1) * 45
    print(chr(slash_calc), end='')

Lua 5.4, 49 bytes
::a::io.write(2>math.random(2)and"\\"or"/")goto a

Try it online!

also 49 bytes: ::a::io.write(({"\\","/"})[math.random(2)])goto a

Go, 78 bytes (fixed seed)
package main
import."math/rand"
func main(){for{print(string(`/\`[Intn(2)]))}}

Attempt This Online!
Prints to STDERR.
Random seed, 107 bytes
package main
import(."math/rand";."time")
func main(){Seed(Now().Unix())
for{print(string(`/\`[Intn(2)]))}}

Attempt This Online!
Also prints to STDERR.

Rust, 143 bytes, std only
use std::hash::*;fn main(){loop{print!("{}",b"/\\"[std::collections::hash_map::RandomState::new().build_hasher().finish()as usize%2]as char);}}

Attempt This Online!
This mess is because the Rust stdlib (at the time of writing) has no "proper" RNG API. So, I had to use the workaround described here to get a random number.

Mathematica - 36 Bytes
Barebones with no formatting. I don't know why the slashes are different thickness
Grid@RandomChoice[{"/","\\"},5{8,5}]

Welcome to Code Golf, and nice answer! Looks like the thickness just has to do with the font, since it's only the backslashes that are thicker.

Easyfuck, 13 12 bytes
ImúUt␗J»␀␒ű€

Decompressed:
$[?%+P.J]@␂/\

How?
$[?%+P.J]@␂/\

$             copy 1st cell into storage
 [      ]     while loop
  ?%+         set 1st cell to 1 or 2
     P.J      move pointer by signed value of 1st cell, print, move pointer to 1st cell
         @    beginning of initializer data
          ␂/\ initializer data (2, 47, 92)
```

TI-Basic, 40 bytes
For(I,1,8
For(J,1,16
Output(I,J,sub("/\",randInt(1,2),1
End
End

Outputs to the entire home screen for monochrome TI-83/84-series calculators. For the color calculators, replace 8 and 16 with 10 and 26 respectively, for +1 byte.

source: Stack Exchange

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

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

sort: votes


text:
Prune connections
John is writing a program that finds the best route from A to B using public transport. For a given pair of origin and destination the program calculates a set of routes with departure time and arrival time, such as this:
10:12 11:45
10:15 11:50
10:22 12:05
10:25 12:00

As you see, the output may include a few routes that are superfluous in the sense that there is another route that starts later and ends earlier. Such routes are certainly never wanted by the user since he cat get out later to arrive sooner.
Your task, if you choose to accept it, is to write a program that prunes a set of routes such that all superfluous rules are eliminated.
Input
The input is a list of newline separated pairs of whitespace separated departure and arrival time in military format (hh:mm). Such a pair is called a route.
You may assume that all times are in the same day and that the arrival time is always later than the departure time. You may also assume that the list is orderer by departure times.
Output
The output is the same list as the input without redundant routes. A redundant route is a route for which another route exists in the list that has a later departure and an earlier arrival time. There must exist an order to remove all redundant routes such that in each step you can show the route that makes the removed route redundant. You don't have to output that order.
Extra credit
Prove or disprove that for each list of input routes there exists exactly one set of output routes.
Restriction

Usual codegolf rules apply

Scoring
To score, apply the function that gives an upper bound to your solutions complexity with your solution's total number of characters. Normalize your bounding function such that a solution length of two character yields a score of two.
For example, if your solution has 24 characters and a complexity of O(2n), your score is 4194304. If your solution has 123 characters and a complexity of O(n2) your score is 7564. If your solution has 200 characters and a complexity of O(n*logn), your score is 734.
I use this scoring method in order to encourage people to implement efficient solutions.

The proof of uniqueness is trivial: this is a special case of identifying maximal elements in a poset.

that starts later and ends earlier - Surely you mean starts earlier and ends later?

@Leigh I hope I fixed the confusion.

@FUZxxl Not sure if it's just me who was confused then :) - I'm of the opinion that a route that starts later and ends earlier gives a wholly shorter journey time overall, and is therefore more desirable to the traveller. Your wording indicates (possibly just to me...) that these shorter routes are the superfluous ones. Possibly a bit of ambiguity around the "Such routes", perhaps.

I wrote: the output may include a few routes that are superfluous in the sense that there is another route that starts later and ends earlier. What would you write?

How about: " As you see, the train schedule may include superfluous departure-arrival options.  A departure-arrival Option A is superfluous if there exists another option, B, that departs after A yet arrives before A. Your task is to identify and remove superfluous options from the train schedule."

@David Ah... now I understand the confusion.

Any rules for scoring command line options, such as -n?

Number of characters excluding the leading dash.

GolfScript, 26 characters, 26 score
n%-1%{6>[0$m]$0=:m=},-1%n*

The solution assumes a list sorted on departure time on input (as noted in the problem description) and also prints a sorted list (if this restriction can be dropped we may save 3 chars).
The code traverses the list backwards and removes any connection where the arrival time is larger than the minimum arrival time processed so far.
n%            # split input at newlines
-1%           # reverse list
{             # filter list...
   6>         # take arrival time of current item
   [0$m]      # make an array consisting of that arrival time and the minimum
              # up to now, contained in variable m. Note since m is not initialized
              # the array will consist of a single item in the first iteration
   $          # sort that array (consisting of one or two items)
   0=         # take first item, i.e. minimum arrival time
   :m         # save to variable m
   =          # compare current item to m and select if both are equal
},            # ... end of filter list
-1%           # reverse list again
n*            # join items with newline

The code can be tested online.

Elegant and functional.

Perl  47 (+1) bytes • O(n) ⇒ 48 score
$#a-=2until$a[-/ \K/]lt$';push@a,$`,$'}{print@a

Adding one byte for the -n option, as per the OP's instructions.
Sample input:
10:30 11:00
10:33 11:18
10:42 11:10
10:47 11:18
10:49 11:26
10:50 11:09
11:00 11:20
11:01 11:28
11:11 11:31
11:21 11:49
11:23 11:53
11:29 12:09
11:36 12:08
11:41 12:15
11:46 12:06
11:53 12:23
11:56 12:32
12:01 12:30
12:04 12:47
12:05 12:25

Sample output:
$ perl -n prune-connections.pl < in.dat
10:30 11:00
10:50 11:09
11:00 11:20
11:01 11:28
11:11 11:31
11:21 11:49
11:23 11:53
11:46 12:06
11:53 12:23
12:05 12:25

Input generator (PHP):
<?php
  for($t = strtotime('10:30'); 20 > $i; $i++) {
    $r = rand(15, 45)*60;
    echo date('H:i', $t), ' ', date('H:i', $t+$r), PHP_EOL;
    $t += rand(0, 10)*60;
  }
?>

Lemma:
If a route  is invalidated by some other route  where , and no other route between  and  invalidates , then  invalidates all routes from  to .
Because the routes are sorted by departure time, and ,  must necessarily have a later departure time than . Then, in order to invalidate ,  needs only to have an earlier arrival time. If there were a route between  and  which was not invalidated by , it would have an earlier arival time than , and hence, would have already invalidated .
Therefore, a linear time algorithm, which only checks if the current route invalidates the previous route is sufficient to solve the problem. When an invalidation is found, the route before the invalidated route must also be checked, until a route is not invalidated (or no valid routes remain). Because a route can only be invalidated once, no more than  routes will be invalidated in this manner.
Note that it is important that the invalid routes actually be removed from the list. If they are simply marked invalid (or set to null, etc.), this will result in  complexity, in the case that each new route invalidates all previous routes.
Proof that only one solution exists follows directly from the law of transitivity. If a route  is invalidated by , and  is invalidated by ,  is also invalidated by . In order for multiple solutions to exist, it must be possible to invalidate  without invalidating , but any route that invalidates  will also invalidate , and will lead to the same solution.

APL 107 57 52 . O(n) = 52
T m
r←m
m←⍎(,0 5↓m)~':'
l:m←(n←(2≤/m),1)/m
r←n⌿r
→(~×/n)/l
r

The input m variable could be simply typed in as follows for the first example below:
m←4 11⍴'10:12 11:4510:15 11:5010:22 12:0510:25 12:00'

or it could be read in programatically from a number of sources eg text file.
The line before the start of the loop converts the character input (m) of arrival times to 4 digit numbers. The loop is then using sequential ≤ on those times to do the pruning. Tested on the following:
10:12 11:45  10:12 11:45  10:12 11:45  10:12 11:45
10:15 11:50  10:15 11:50  10:15 11:50  10:15 11:50
10:22 12:05  10:22 12:05  10:22 12:05  10:22 12:05
10:25 12:00  10:25 12:00  10:25 12:00  10:25 12:00
===========  10:30 11:55  10:30 11:55  10:30 11:55
10:12 11:45  ===========  10:35 12:10  10:35 12:10
10:15 11:50  10:12 11:45  ===========  10:40 11:40
10:25 12:00  10:15 11:50  10:12 11:45  ===========
             10:30 11:55  10:15 11:50  10:40 11:40
                          10:30 11:55
                          10:35 12:10

I don't speak APL, but judging by the English that's O(n squared), giving a score of 11449.

@histocrat If you accept primo's explanation of the solution then it is O(n).

I'm curious how to test this solution. I've tried running this code (assuming that m is the variable that needs to be assigned to the input?), but running it on this online apl interpreter produces the runtime error Symbol 'T' referenced before assignment. Have I missed something?

@primo That interpreter does not implement the full set of APL functions. It is failing on the third line of code with error: Function ⍎ Execute is not implemented. In your example the result of that line is effectively m←1145 1150 1205 1200

@Graham what would be your recommendation for testing this solution (or any other APL solution, for that matter)?

@primo you could try [link]http://www.nars2000.org/).

@primo I should add that this should work with most of my stuff which I write mostly in plain vanilla APL but will not work with some of the code using proprietary extensions to the language.

@primo I just installed the nars2000 interpreter and it works perfectly with the three submissions I have made to this site recently.

Could you perhaps edit your answer to demonstrate how your program is run? Surely it needs to get its input from somewhere.

let us continue this discussion in chat

Python 82 • O(n) = 82
New to code golfing. Dunno if I am breaking any rules.
i=-1
while len(a)>-i:
 if a[i][6:]<a[i-1][6:]:a.pop(i-1)
 else:i-=1
print ''.join(a)

The algorithm is to iterate from the back of the list, removing the previous line if it has a later arrival time or moving the pointer to the previous line otherwise.
Note: The definition of redundant routes given by the OP is taken to the word, so neither of the two routes which have the same arrival times but different departure times are removed.

In Python list.pop() is O(n) operation. So this program is O(n^2) in worst case.

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


text:
Bitwise Operators in Brainfuck
Your task is to create one brainfuck program for each of the following binary operators. Each program should take one or two 8-bit numbers (A and B) from input and calculate the specified operation:

A XOR B
A AND B
A OR B
A Shifted Left by 1 (circular shift)
NOT A

You do not have to implement all 5. Score is calculated by:
#totalCharacters + {4000 * #problemsNotCompleted}

So valid scores are from zero (best) to 20,000(nothing completed).
I don't care where you store the result, or whether or not you preserve the input. Assume 8-bit cells, and as many empty cells as you need to the right only.
You may assume the numbers are already in whatever memory location works best for you, so you don't need to worry about IO operations.

Can we also solve the task in a similary minimalistic language such as iot?

I have no objections to any other languages, as long as there are no built in bitwise operators.

Score: 275
It works better to expand these with a binary counter. The less intuitive parts deal with the possibility that A or B is 0. I didn't find a profitable way to use nondestructive flow control in the actual bit manipulation of the first three. Incidentally these should all work fine with 16-bit cells and slowly with 32-bit.
XOR, 86
Assumes A and B are in cells 1 and 2, stores A XOR B in cell 2, pointer starts in cell 0 and ends in cell 5.
-[[>>>>>>[>>>]++[-<<<]<<<-]>]>>>[<]>[[>[>-<-]>[<<<<<<+>>>>>>[-]]>]+[<[<<<++>>>-]<<]>>]

AND, 78
Assumes A and B are in cells 1 and 2, stores A OR B in cell 4, pointer starts in cell 0 and ends in cell 5.
-[[>>>>>>[>>>]++[-<<<]<<<-]>]>>>[<]>[[>[>[<<<<+>>>>-]<-]>+>]<[<[<<<++>>>-]<<]]

OR, 86
Assumes A and B are in cells 1 and 2, stores A OR B in cell 2, pointer starts in cell 0 and ends in cell 5.
-[[>>>>>>[>>>]++[-<<<]<<<-]>]>>>[<]>[[>[>+<-]>[<<<<<<+>>>>>>[-]]>]+[<[<<<++>>>-]<<]>>]

ROL, 18
Assumes A is in cell 0, stores A ROL 1 in cell 1, pointer starts and ends in cell 0.
[>++[>>]<[>+>]<<-]

NOT, 7
Assumes A is in cell 0, stores NOT A in cell 1, pointer starts and ends in cell 0.
+[>-<-]

That's really short and pretty cool. +1

Seriously impressive improvements.

Score: 686
All snippets assume that the numbers are already loaded in cell 0 and 1 and that the pointer points to cell 0.
I can add an atoi snippet later if that's required for the challenge. For now, you can try the code like this:
+++++++++>    number 1
++++<         number 2

XOR, 221
Result is written to cell 10, pointer ends at cell 5
>>>>>++++++++[-<<<<<[->>+<<[->>->+<]>>[->>>>+<<]<<<<]>>>[-<<<+>>>]<<[->+<[->->+>
>>>>]>[->>>>>+>>]<<<<<<<<]>>[-<<+>>]>>>[->>+<<]>[>[-<->]<[->+<]]>[[-]<<<[->+>-<<
]>[-<+>]+>+++++++[-<[->>++<<]>>[-<<+>>]<]<[->>>>+<<<<]>>]<<<]

AND, 209
Result is written to cell 10, pointer ends at cell 5
>>>>>++++++++[-<<<<<[->>+<<[->>->+<]>>[->>>>+<<]<<<<]>>>[-<<<+>>>]<<[->+<[->->+>
>>>>]>[->>>>>+>>]<<<<<<<<]>>[-<<+>>]>>>[->[->+<]<]>[-]>[-<<<[->+>-<<]>[-<+>]+>++
+++++[-<[->>++<<]>>[-<<+>>]<]<[->>>>+<<<<]>>]<<<]

OR, 211
Result is written to cell 10, pointer ends at cell 5
>>>>>++++++++[-<<<<<[->>+<<[->>->+<]>>[->>>>+<<]<<<<]>>>[-<<<+>>>]<<[->+<[->->+>
>>>>]>[->>>>>+>>]<<<<<<<<]>>[-<<+>>]>>>[->>+<<]>[->+<]>[[-]<<<[->+>-<<]>[-<+>]+>
+++++++[-<[->>++<<]>>[-<<+>>]<]<[->>>>+<<<<]>>]<<<]

Rotate Left, 38
Result is written to cell 1, pointer ends at cell 4
[->++>+<[>-]>[->>+<]<<<]>>>>[-<<<+>>>]

NOT, 7
Result is written to cell 1, pointer ends at cell 0
+[+>+<]

Explanation:
XOR, AND and OR all work in a similiar fashion: Calculate n/2 for each number
and remember n mod 2. Calculate the logical XOR/AND/OR for the single bits. If
the resulting bit is set, add 2^n to the result. Repeat that 8 times.
This is the memory layout I used:
 0      1        2        3      4        5         6        7
n1  |  n2  |  marker  |  n/2  |  0  |  counter  |  bit1  |  bit2  |

  8        9        10
temp  |  temp  |  result

Here's the source for XOR (numbers indicate where the pointer is at that time):
>>>>>
++++ ++++ counter
[
    -
    <<<<<

    divide n1 by two
    [ 0
        -
        >>+ set marker 2
        << 0
        [->>->+<] dec marker inc n/2
        >> 2 or 4
        [->>>>+<<]
        <<<<
    ]
    >>>
    [-<<<+>>>]
    <<

    divide n2 by two
    [ 1
        -
        >+ set marker 2
        < 1
        [->->+>>>>>] dec marker inc n/2
        > 2 or 9
        [->>>>>+>>]
        <<<< <<<<
    ]
    >>[-<<+>>] 3

    >>> 6

    [->>+<<]>[>[-<->]<[->+<]]>  one bit xor 8

    [
        [-]<<< 5
        [->+>-<<] copy counter negative
        > 6
        [-<+>]
        +> 7
        ++++ +++  cell 6 contains a one and cell 7 how many bits to shift
        [-<[->>++<<]>>[-<<+>>]<]  2^n
        < 6
        [->>>>+<<<<]
        >> 8
    ]

    <<<
]

For left rotate, once again there is a marker in cell 2 to determine if 2n
is zero, since you can only determine if a cell is non-zero directly. If
so, a carry bit is written to cell 4 and later added to 2n. This is the memory
layout:
0      1        2       3       4
n  |  2n  |  marker  |  0  |  carry

Great work! I did intend for each program to take input from the console, but the more I think about it, your way works fine. No need to make you add ,>,<. I'll edit question.

I would be interested to hear a bit of an explanation for how these are working. It looks like your first three are pretty similar except for the innermost part, but I am not sure if you are doing some kind of binary expansion (hence 8 cells needed), or a bit by bit compare, or some combination of the two. Hard to see by stepping through.

@CMP I'll add an explanation later

Score (current): 12038 837/-
The programs assume numbers are loaded in whatever cell is specified, by , or similar. It also assumes that all cells are 8-bit unsigned with wrapping as needed. At the start of each snippet, numbers are loaded at cell 0 (and 1 if needed).
Bit operations - 799
The bit operations follow the same general structure.
Firstly, we define a divmod 2 (DM2) function.
CELLS:   A  B   C  D
INPUT:  *A  0   0  0
OUTPUT: *0 A/2 A%2 0
dp@A; while{
  dec A,2; inc B,1; dp@A; inc A,1
  while{ #Check if A was 1 at the start
    dec D,1; pour A,C; dp@A;
  }
  dec C,1; pour C,A; inc D,1; dp@D
  #If A was 1 at the start, D will be 1 here
  while{
    dec D,1; inc C,1; dec B,1; dp@D
  }
  dp@A
}
Translated into BF, we have
    [->+<[>>>-<<<[->>+<<]]>>-[<<+>>-]>+[-<+<->>]<<<]
I'm not that good at BF, so my algorithm may not be the smallest.

Next, we define the program.
In this, we assume that the numbers are loaded in $2 (cell 2) and $3.

inc $1,8; dp@1 {
  dec  $1
  pour $3,$6
  DM2  $2        # result in $3,$4
  DM2  $6        # result in $7,$8
  pour $7, $2
  pour $8,$5
  bop  $4,$5     # result in $6
  pour $1,$5
  pour $5,$4,$1
  down $4,$5     # decrease $4 till 0, decrease $5 by same amount
  inc  $5,#7
  shl  $6,$5
  pour $6,$0     # $0 is result
  dp@  1
}
#Now, the result is in $0

Translated to BF (with linebreaks for readability):
  >++++++++[
    ->>[->>>+<<<]<
    [->+<[>>>-<<<[->>+<<]]>>-[<<+>>-]>+[-<+<->>]<<<]>>>>  #DM2 $2
    [->+<[>>>-<<<[->>+<<]]>>-[<<+>>-]>+[-<+<->>]<<<]>     #DM2 $6
    [-<<<<<+>>>>>]>
    [-<<<+>>>]<<<<
    (bop)<<<
    [->>>>+<<<<]>>>>
    [<+<<<+>>>>-]<
    [->-<]>
    +++++++
    [->[-<<++>>]<<[->>+<<]>]
    [-<<<<<<+>>>>>>]
    <<<<<
  ]

Replace (bop) by the appropriate expression.

XOR works like this: (252-5+15=262)
  [->-<]>[[-]>+<]
AND works like this: (252-5+11=258)
  [>[>+<-]<-]
OR  works like this: (252-5+32=279)
  [->>>+<<<]>[->>+<<]>>[[-]<+>]<<<

So, combining these, we have a total of 262+258+279=799 D:

Rotate Left A, 1 - 31/-
The number A is loaded in cell 0.
Pseudocode
    $0 := A
    $1 := $0 << 1    # this has the effect of discarding the top bit of A
    $2 := $0
    $3 := $0 << 1
    $2 -= $1 >> 1    # $2 now contains the top bit of A
    if $2 then $3++  # $3 now contains A rotated left 1
    res:= $3         # the result is in cell 3 now

Real code
    [->++>+>++<<<]>[-->-<]>[>+<[-]]
If you don't always need the pointer in the same position,
substitute [>+>] for the last loop (3 less chars).
However, the pointer will then sometimes end up in position 2, sometimes in position 4.

NOT A - 7
The number A is loaded in cell 0.
Pseudocode
    $0  := A
    $0  += 1
    $1  := 256-$0   #since ~A=255-A
    res := $1

+[->-<]


text:
Count from 1 to 100... in Roman Numerals
Write a program that count from 1 to 100 in Roman Numerals and print these numbers by standard output. Each one of the numbers must be separated by spaces.
You cannot use any built in function to transform to roman numerals nor external application or library to do so.
The desired result is
I II III IV V VI VII VIII IX X XI XII XIII XIV XV XVI XVII XVIII XIX XX XXI XXII XXIII XXIV XXV XXVI XXVII XXVIII XXIX XXX XXXI XXXII XXXIII XXXIV XXXV XXXVI XXXVII XXXVIII XXXIX XL XLI XLII XLIII XLIV XLV XLVI XLVII XLVIII XLIX L LI LII LIII LIV LV LVI LVII LVIII LIX LX LXI LXII LXIII LXIV LXV LXVI LXVII LXVIII LXIX LXX LXXI LXXII LXXIII LXXIV LXXV LXXVI LXXVII LXXVIII LXXIX LXXX LXXXI LXXXII LXXXIII LXXXIV LXXXV LXXXVI LXXXVII LXXXVIII LXXXIX XC XCI XCII XCIII XCIV XCV XCVI XCVII XCVIII XCIX C

As it is a code golf challenge, shortest code wins.

39 is missing an X.

I really want to use INTERCAL for this one.

can it be separated by newlines? Also what about trailing/leading spaces/newlines?

Perl 69 bytes
s;.;y/XVI60-9/CLXVIX/dfor$a[$_].="32e$&"%72726;gefor 1..100;print"@a"

Works by way of magic formula. The expression "32e$&"%72726 transforms each digit in the following manner:
0⇒32, 1⇒320, 2⇒3200, 3⇒32000, 4⇒29096, 5⇒56, 6⇒560, 7⇒5600, 8⇒56000, 9⇒50918
After applying the translation y/016/IXV/, we have this instead:
0⇒32, 1⇒32I, 2⇒32II, 3⇒32III, 4⇒29I9V, 5⇒5V, 6⇒5VI, 7⇒5VII, 8⇒5VIII, 9⇒5I9X8
The rest of the digits (2-57-9) are removed. Note that this could be improved by one byte by using a formula which translates 012 instead of 016, simplifying /XVI60-9/ to /XVI0-9/. I wasn't able to find one, but maybe you'll have better luck.
Once one digit has been transformed in this manner, the process repeats for the next digit, appending the result, and translating the previous XVIs to CLX at the same time the translation for the new digit occurs.
Update
Exhaustive search didn't reveal anything shorter. I did, however, find an alternative 69 byte solution:
s;.;y/XVI0-9/CLXIXV/dfor$a[$_].="57e$&"%474976;gefor 1..100;print"@a"

This one uses a 0-2 substitution for IXV, but has a modulo that's one digit longer.

Update: 66 65 bytes
This version is notably different, so I should probably say a few words about it. The formula it uses is actually one byte longer!
Unable to shorten the formula any more than it is, I decided to golf down what I had. It wasn't long until I remembered my old friend $\. When a print statment is issued, $\ is automatically appended to the end of the output. I was able to get rid of the awkward $a[$_] construction for a two byte improvement:
s;.;y/XVI60-9/CLXVIX/dfor$\.="32e$&"%72726;ge,$\=!print$"for 1..100

Much better, but that $\=!print$" still looked a bit verbose. I then remembered an alternative, equal length formula I had found which didn't contain the number 3 in any of its digit transforms. So, it should be possible to use $\=2+print instead, and substitute the resulting 3 with a space:
s;.;y/XVI0-9/CLXIIX V/dfor$\.="8e$&"%61535;ge,$\=2+print for 1..100

Also 67 bytes, due to the necessary whitespace between print and for.

Edit: This can be improved by one byte, by moving the print to the front:
$\=2+print!s;.;y/XVI0-9/CLXIIX V/dfor$\.="8e$&"%61535;gefor 1..100

Because the substitution needs to evaluate completely before the print, the assignment to $\ will still occur last. Removing the whitespace between ge and for will issue a deprecation warning, but is otherwise valid.

But, if there were a formula which didn't use a 1 anywhere, $\=2+print becomes $\=print for another two bytes worth of savings. Even if it were one byte longer, it'd still be an improvement.
As it turns out, such a formula does exist, but it is one byte longer than the original, resulting in a final score of 65 bytes:
$\=print!s;.;y/XVI60-9/CLXXI V/dfor$\.="37e$&"%97366;gefor 1..100

Methodology
The question was asked how one might go about finding such a formula. In general, finding a magic formula to generalize any set of data is matter of probability. That is, you want to choose a form which is as likely as possible to produce something similar to the desired result.
Examing the first few roman numerals:
0:
1: I
2: II
3: III
4: IV
5: V
6: VI
7: VII
8: VIII
9: IX

there is some regularity to be seen. Specifically, from 0-3 and then again from 5-8, each successive term increases in length by one numeral. If we wanted to create a mapping from digits to numerals, we would want to have an expression that also increases in length by one digit for each successive term. A logical choice is k • 10d where d is the corresponding digit, and k is any integer constant.
This works for 0-3, but 4 needs to break the pattern. What we can do here is tack on a modulo:
k • 10d % m, where m is somewhere between k • 103 and k • 104. This will leave the range 0-3 untouched, and modify 4 such that it won't contain four Is. If we additionally constrain our search algorithm such that the modular residue of 5, let's call it j, is less than m / 1000, this will ensure that we also have regularity from 5-8 as well. The result is something like this:
0: k
1: k0
2: k00
3: k000
4: ????
5: j
6: j0
7: j00
8: j000
9: ????

As you can see, if we replace 0 with I, 0-3 and 5-8 are all guaranteed to be mapped correctly! The values for 4 and 9 need to be brute forced though. Specifically, 4 needs to contain one 0 and one j (in that order), and 9 needs to contain one 0, followed by one other digit that doesn't appear anywhere else. Certainly, there are a number of other formulae, which by some fluke of a coincidence might produce the desired result. Some of them may even be shorter. But I don't think there are any which are as likely to succeed as this one.
I also experimented with multiple replacements for I and/or V with some success. But alas, nothing shorter than what I already had. Here is a list of the shortest solutions I found (the number of solutions 1-2 bytes heavier are too many to list):
y/XVI60-9/CLXVIX/dfor$\.="32e$&"%72726
y/XVI0-9/CLXIXV/dfor$\.="57e$&"%474976
y/XVI0-9/CLXIVXI/dfor$\.="49e$&"%87971

y/XVI0-9/CLXIIXIV/dfor$\.="7e$&"%10606  #
y/XVI0-9/CLXIIXIV/dfor$\.="7e$&"%15909  # These are all essentially the same
y/XVI0-9/CLXIIXIV/dfor$\.="7e$&"%31818  #

y/XVI0-9/CLXIIX V/dfor$\.="8e$&"%61535  # Doesn't contain 3 anywhere

y/XVI60-9/CLXXI V/dfor$\.="37e$&"%97366 # Doesn't contain 1 anywhere

How did you find the magic formula?

@RubenVerborgh I'll update my post with more information regarding the methodology soon.

HTML + JavaScript + CSS (137)
HTML (9)

JavaScript (101)
for(i=1;i<=100;i++){document.getElementsByTagName('ol')[0].appendChild(document.createElement('li'))}

CSS (27)
ol{list-style:upper-roman}

Output

...
Demo on JSBin

81 byte JS-only version: document.write('
'+"
".repeat(100)+'
') (ES6)

or 66 in Chrome document.write("
".repeat(100))

63 if we omit attribute quotes and the slash: document.write("
".repeat(100))

Python 116
better golfed code of scleaver's answer:
r=lambda a,b,c:('',a,2*a,3*a,a+b,b,b+a,b+a+a,b+3*a,a+c);print' '.join(i+j for i in r(*'XLC')for j in r(*'IVX'))+' C'

Python, 139
print' '.join(' '.join(i+j for  j in ' _I_II_III_IV_V_VI_VII_VIII_IX'.split('_'))for i in ' _X_XX_XXX_XL_L_LX_LXX_LXXX_XC'.split('_'))+' C'

C, 177 160 147 chars
There are shorter solutions, but none in C, so here's my try.
New solution, completely different from my previous one:
char*c;
f(n){
    printf("%.*s",n%5>3?2:n%5+n/5,c+=n%5>3?n%4*4:2-n/5);
}
main(i){
        for(;i<100;putchar(32))
                c="XLXXXC",f(i/10),
                c="IVIIIX",f(i++%10);
        puts("C");
}

Previous solution (160 chars):
Logic:
1. f prints a number from 1 to 10. c is the digits used, which can be IVX or XLC. Called once for the tens once for the ones.
2. If n%5==0 - print nothing or c[n/5] which is I or V (or L or C).
3. If n%4==4 - 4 or 9 - print I (or X), by n+1.
4. If n>4 - print 5 (i.e. V or L) then n-5.
5. If n<4 - print I then n-1 (i.e. n times I).
char*c;
p(c){putchar(c);}
f(n){
        n%5?
                n%5>3?
                        f(1),f(n+1):
                        n>4?
                                f(5),f(n-5):
                                f(n-1,p(*c)):
                n&&p(c[n/5]);
}
main(i){
        for(;++i<101;p(32))
                c="XLC",f(i/10),
                c="IVX",f(i%10);
        p(10);
}

137: f(c,n){printf("%.*s",n%5>3?2:n%5+n/5,"XLXXXCIVIIIX "+c+(n%5>3?n%4*4:2-n/5));}main(i){for(;i<100;f(12,4))f(0,i/10),f(6,i++%10);puts("C");}

Mathematica 159 150 142
c = {100, 90, 50, 40, 10, 9, 5, 4, 1};
Table["" <> Flatten[ConstantArray @@@ Thread@{StringSplit@"C XC L XL X IX V IV I",
  FoldList[Mod, k, Most@c]~Quotient~c}], {k, 100}]

Built-in solution: IntegerString, 38 chars
IntegerString[k, "Roman"]~Table~{k, 100}

JavaScript, 123
Inspired by a longer version I came across in a Polish newsgroup (at least, Chrome thought it was Polish).
for(i=100,a=[];n=i--;a[i]=r)
  for(r=y='',x=5;n;y++,x^=7)
    for(m=n%x,n=n/x^0;m--;)
      r='IVXLC'[m>2?y+n-(n&=-2)+(m=1):+y]+r;
alert(a)

Q (81 80)
2nd cut:
1_,/'[($)``X`XX`XXX`XL`L`LX`LXX`LXXX`XC cross``I`II`III`IV`V`VI`VII`VIII`IX],"C"

1st cut:
1_,/'[$:[``X`XX`XXX`XL`L`LX`LXX`LXXX`XC cross``I`II`III`IV`V`VI`VII`VIII`IX]],"C"

Python, 168
r=lambda n,l,v:(r(n,l[1:],v[1:])if n<v[0]else l[0]+r(n-v[0],l,v))if n else''
for i in range(1,101):print r(i,'C XC L XL X IX V IV I'.split(),[100,90,50,40,10,9,5,4,1]),

Explanation
Using these values, take the largest value not greater than n and subtract it from n.  Repeat until n is 0.
'C'  = 100
'XC' = 90
'L'  = 50
'XL' = 40
'X'  = 10
'IX' = 9
'V'  = 5
'IV' = 4
'I'  = 1

r=lambda n,l,v:n and(n<v[0]and r(n,l[1:],v[1:])or l[0]+r(n-v[0],l,v))or"" saves two characters. Otherwise very nice.

Ruby 1.9, 140 132
r=" "
100.times{r+=?I
0while[[?I*4,"IV"],["VIV","IX"],[?X*4,"XL"],["LXL","XC"],[/(.)((?!\1)[^I])\1/,'\2']].any?{|q|r.sub! *q}
$><<r}

This literally counts from 1 to 100 in Roman numerals.  Starts with a blank string, then loops through appending "I" and then repeatedly applying a series of substitution rules, effectively adding 1.
Edit: Added version number, since ?I only works in 1.9, and used @Howard's changes to trim some characters.

You may save two chars: r while -> 0while, r.sub!(*q) -> r.sub! *q. You can also drag the print inside the loop and use 100.times{...} instead of the map statement.

(%w[IIII VIV XXXX LXL]<</(.)((?!\1)[^I])\1/).zip(%w(IV IX XL XC)<<'\2') saves 7 chars.

Ruby 112 chars
101.times{|n|r=' ';[100,90,50,40,10,9,5,4,1].zip(%w(C XC L XL X IX V IV I)){|(k,v)|a,n=n.divmod k;r<<v*a};$><<r}

Basically using the to_roman method explained here, but using a zipped array for brevity.

perl 205
@r = split //, "IVXLC";
@n = (1, 5, 10, 50, 100);

for $num (1..100) {
  for($i=@r-1; $i>=0; $i--) {
    $d = int($num / $n[$i]);
    next if not $d;
    $_ .= $r[$i] x $d;
    $num -= $d * $n[$i];
  }
  $_ .= " ";
}
s/LXXXX/XC/g;
s/XXXX/XL/g;
s/VIIII/IX/g;
s/IIII/IV/g;
print;

Golfed:
@r=split//,"IVXLC";@n=(1,5,10,50,100);for$num(1..100){for($i=@r-1;$i>=0;$i--){$d=int($num/$n[$i]);next if!$d;$_.=$r[$i]x$d;$num-=$d*$n[$i];}$_.=" ";}s/LXXXX/XC/g;s/XXXX/XL/g;s/VIIII/IX/g;s/IIII/IV/g;print;

MUMPS 184
S V(100)="C",V(90)="XC",V(50)="L",V(40)="XL",V(10)="X",V(9)="IX",V(5)="V",V(4)="IV",V(1)="I" F I=1:1:100 S S=I,N="" F  Q:'S  S N=$O(V(N),-1) I S&(S'<N ) S S=S-N W V(N) S N="" w:'S " "

Same algorithm as @cardboard_box, from whom I've taken the explanation verbatim -
Explanation
Using these values, take the largest value not greater than n and subtract it from n.  Repeat until n is 0.
'C'  = 100
'XC' = 90
'L'  = 50
'XL' = 40
'X'  = 10
'IX' = 9
'V'  = 5
'IV' = 4
'I'  = 1

R, 85 bytes
R=.romans
for(r in 1:100){while(r>0){cat(names(R[I<-R<=r][1]))
r=r-R[I][1]}
cat(" ")}

Try it online!
Uses the random utils package variable .romans to get the values of the roman numerals, but does the conversion by itself; the builtin approach would be 20 bytes: cat(as.roman(1:100))

Surprisingly, the built-in approach you are mentioning does not work as is... one has to type cat(paste(as.roman(1:100))) or simply as.roman(1:100). Weird.

@JayCe odd; I must not have actually tested it...the docs for cat indicate that it performs less conversion than print and only works on atomic vectors -- so that explains this!

APL (Dyalog Unicode), 61 bytes
∊{'IVXLC'[∊5 3 1+{(⍺=0)↓⍺↑⍨⊃¯2,⍨⍵~0}⌿0 5⊤1+⍵⊤⍨3⍴10],' '}¨⍳100

Try it online!
(I know there's already an APL answer, but wanted to re-solve it anyway)
Adapted and golfed from Nikolay Nikolov's piece of code that supports up to M at the bottom of this page.
How it works
∊{'IVXLC'[∊5 3 1+{(⍺=0)↓⍺↑⍨⊃¯2,⍨⍵~0}⌿0 5⊤1+⍵⊤⍨3⍴10],' '}¨⍳100
∊{'IVXLC'[...],' '}¨⍳100  ⍝ Less interesting part
                    ⍳100  ⍝ 1-based range; 1 to 100 inclusive
 {        ...     }¨      ⍝ Compute a representation for each number
  'IVXLC'[   ],' '        ⍝ Index into the string and pad with a space
∊                         ⍝ Concatenate the strings

∊5 3 1+{(⍺=0)↓⍺↑⍨⊃¯2,⍨⍵~0}⌿0 5⊤1+⍵⊤⍨3⍴10  ⍝ Interesting part
                                 ⍵⊤⍨3⍴10  ⍝ Last 3 decimal digits of ⍵
                           0 5⊤1+  ⍝ Divmod of each digit +1 by 5
       {                 }⌿  ⍝ Compute the partial roman representation:
⍝  Digit  0  1   2     3       4
⍝  Div    0  0   0     0       1
⍝  Mod    1  2   3     4       0
⍝  Result [] [0] [0 0] [0 0 0] [0 1]
⍝  Digit  5   6     7       8         9
⍝  Div    1   1     1       1         2
⍝  Mod    1   2     3       4         0
⍝  Result [1] [1 0] [1 0 0] [1 0 0 0] [0 2]
                 ⊃¯2,⍨⍵~0  ⍝ ¯2 if mod is 0, keep mod otherwise
              ⍺↑⍨          ⍝ Overtake div with the above
                           ⍝ (¯2: add 0 to the left; other: add (mod-1) 0s to the right)
        (⍺=0)↓             ⍝ Drop one if div is 0
 5 3 1+  ⍝ Offset each nested array to point to correct roman unit
∊        ⍝ Flatten

OP said "You cannot use any built in function to transform to roman numerals" but didn't say about a built-in that does arithmetic over roman numerals, so this one could be technically valid:
APL (Dyalog Unicode), 29 bytes
⎕CY'dfns'
∊,∘' '¨{⍳⍵}roman'C'

Try it online!
This one leverages the library operator roman that does various arithmetic over roman numerals (that is, the input is also a roman numeral). So this basically computes the 1-based range {⍳⍵} over roman numerals with the input value 'C' (100), appends a space to each string ,∘' '¨ and flattens them ∊.

Extended: ∊,∘' '¨⍳⌂roman'C'

APL 128
I tried an indexing solution in APL:
r←⍬
i←1
l:r←r,' ',('   CXI LV CX'[,⍉((1+(4 4 2 2⊤0 16 20 22 24 32 36 38 39 28)[;1+(3⍴10)⊤i])×3)-4 3⍴2 1 0])~' '
→(100≥i←i+1)/l
r

It can be 4 bytes shorter in index origin 0 instead of 1 but the real space hog is the generation of the index matrix via:
4 4 2 2⊤0 16 20 22 24 32 36 38 39 28

So far I have not been able to generate the indices on the fly!

LaTeX (138)
\documentclass{minimal}
\usepackage{forloop}
\begin{document}
\newcounter{i}
\forloop{i}{1}{\value{i} < 101}{\roman{i}\par}
\end{document}

-1: the question says "You cannot use any built in function to transform to roman numerals"

Python, 125
' '.join(i+j for i in['']+'X XX XXX XL L LX LXX LXXX XC C'.split()for j in['']+'I II III IV V VI VII VIII IX'.split())[1:-38]

PHP, 38 37 bytes

<?=str_repeat("
",100);
-1 byte thanks to @manatwork
Same idea as Patrick's answer, but in a more compact language. Beats Mathematica!
Try it Online!

Terminate the statement with ;, then no need for ?>.

VBA (Excel), 245 bytes
created Function for Repetition and Replace - 91 bytes
Function s(a,b):s=String(a,b):End Function
Function b(x,y,z):b=Replace(x,y,z):End Function
using immediate window (154 bytes)
p="I":for x=1to 100:?b(b(b(b(b(b(b(b(s(x,p),s(100,p),"C"),s(90,p),"XC"),s(50,p),"L"),s(40,p),"XL"),s(10,p),"X"),s(9,p),"IX"),s(5,p),"V"),s(4,p),"IV"):next

TeX, 354 bytes
\let~\let~\d\def~\a\advance~\b\divide~\x\expandafter~\f\ifnum{~~\newcount~\n~\i~\j~\k~\u~\v}~~\or\d\p#1{\ifcase#1C~2~L~5~X~2~V~5~I\fi}\d\q#1{\p{#1~}}\d\r{\j0
\v100\d\m{\d\w{\f\n<\v\else\p\j\a\n-\v\x\w\fi}\w\f\n>0\k\j\u\v\d\g{\a\k2\b\u\q\k}\g\f\q\k=2\g\fi\a\n\u\f\n<\v\a\n-\u\a\j2\b\v\q\j\else\p\k\fi\x\m\fi}\m}\i1\d\c{
\f\i<101 \n\i\r\a\i1 \x\c\fi}\c\bye

Some explanation: TeX provides a built-in command \romannumeral for converting numbers to Roman numerals. As the question doesn't allow to use built-in functions, the above code is a golfed version of the same algorithm Knuth's original TeX compiler uses for \romannumeral (see TeX: The Program, § 69, print_roman_int) re-implemented in TeX.
As he wants to leave the joy of puzzling out how this code works to the reader, Knuth refuses to give an explanation of this part of the code. So I'll follow suit and just give an ungolfed and slightly modified version, which is closer to the original than the above code:
\newcount\n
\newcount\j
\newcount\k
\newcount\u
\newcount\v

\def\chrnum#1{\ifcase#1m\or 2\or d\or 5\or c\or 2\or l\or 5\or x\or 2\or v\or 5\or i\fi}
\def\chrnumM#1{\chrnum{#1\or}}

\def\roman#1{%
    \n=#1\relax
    \j=0\relax
    \v=1000\relax
    \def\mainloop{%
        \def\while{%
            \ifnum\n<\v
            \else
                \chrnum\j
                \advance\n -\v
                \expandafter\while
            \fi
        }\while
        \ifnum\n>0\relax
            \k=\j \advance\k 2\relax
            \u=\v \divide\u \chrnumM\k
            \ifnum\chrnumM\k=2\relax
                \advance\k 2\relax
                \divide\u \chrnumM\k
            \fi
            \advance\n \u
            \ifnum\n<\v
                \advance\n -\u
                \advance\j 2\relax
                \divide\v \chrnumM\j
            \else
                \chrnum\k
            \fi
            \expandafter\mainloop
        \fi
    }\mainloop
}

\newcount\i \i=1
\def\countloop{%
    \ifnum\i<100\relax
        \roman\i\
        \advance\i 1
        \expandafter\countloop
    \fi
}\countloop
\bye

Java (OpenJDK 8), 152 bytes
a->{String[] t=",X,XX,XXX,XL,L,LX,LXX,LXXX,XC,,I,II,III,IV,V,VI,VII,VIII,IX".split(",");for(int i=1;i<100;i++){a+=t[i/10]+t[i%10+10]+" ";}return a+"C";}

Try it online!
Explanation:
String[] t=",X,XX,XXX,XL,L,LX,LXX,LXXX,XC,,I,II,III,IV,V,VI,VII,VIII,IX".split(",");
//Create an array of numerals, first half represents tens place, second half represents ones place
    for(int i=1;i<100;i++){
//Loop 99 times
        a+=t[i/10]+t[i%10+10]+" ";
//Add tens place and ones place to the string
    }return a+"C";
//Add numeral for 100 and return the string

148 bytes

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


text:
Convert the Binary Champernowne Constant to Decimal
The Champernowne constant is a transcendental decimal number whose digits are the concatination of all positive integers.
C10 =  0.12345678910111213141516...10
The binary version of this is
C2 = 0.1101110010111011110001...2
Write a program that prints C2 in decimal.  The program should never halt.  It should continue printing digits such that given infinite time and memory, it will print an infinite number of correct digits.
To illustrate this, you must account for integer overflow, since integer overflow will either cause an error or print incorrect digits, even with infinite memory available.
To test your code, here are the first 150 digits of this number.
0.862240125868054571557790283249394578565764742768299094516071214557306740590516458042038441438618133400466718933678923129464456214392016383510596824661

Shortest code wins.

the last digit of C_2 is wrong. should be removed or changed to 1

Python 119 bytes
import sys
r=i=n=0
while 1:
 i+=1
 for b in bin(i)[2:]:n+=1;r=r*10+int(b)*5**n;~n%4or sys.stdout.write(('0.'+`r`)[n/4])

Given unlimited memory, this will run indefinitely, although it does slow down quite a bit after the first few thousand digits.
Each binary bit is treated as its corresponding power of 5, i.e:
0.1 ⇒ 5, 0.01 ⇒ 25, 0.001 ⇒ 125, 0.0001 ⇒ 625, etc.
Which lends itself nicely to a decimal conversion, as:
1/2 = 0.5, 1/4 = 0.25, 1/8 = 0.125, 1/16 = 0.0625, etc.
The variable r stores a running total of all bits so far (increasing by a factor of 10 each iteration), and every four bits the next digit is output. This is mathematically correct, because log2(10) ≈ 3.321928
which means that every 3.32 or so binary bits will produce one decimal digit. 10/3 is a better upper bound, but I chose 4 for sake of brevity.
Ruby 80 bytes
r=i=n=0
$><<gsub(/./){"0.#{r=r*10+$&.to_i*5**n+=1}"[n/4,n%4/3]}while$_='%b'%i+=1

Same algorithm as above. It's been a while since I've golfed Ruby, so I may be missing a few tricks.
GolfScript 53 bytes
0:µ.{).2base{5µ):µ?*@10*+.'0.'\+µ4/<µ(4/>print\}/.}do

Once again, same algorithm. This is one of the first things I've ever written in GolfScript, so I'm fairly certain that it can be reduced further. I've chosen to use µ (char 181) as a variable name, because it saves a whitespace in the expression µ4/.

I'm eventually going to just give up any time I see an answer by primo. I can't win.

I've participated in several different code golfing sites/fora, typically with automated scoring. The major drawback is that you can't share your solution with anyone. I was a bit hesitant at first, but I've come to enjoy the Q&A format, particularly because you can share with everyone. I might be a bit long-winded regarding implementation details, but this is exactly what I like to see in other posts. I routinely vote up other solutions in the same thread, if they make me think about the problem in a new way. If I thought I were discouraging other users from posting, I would stop.

Not at all, I'm learning a lot from your answers. My comment was meant to be humorous and praising. You always approach the questions in ways I might never have considered. TBH, I actually look for your answers because I know they'll be great resources, and kind of get crestfallen when I can't find them. I'm still trying to work out your Pokemon solution in PHP, for example. As a PHP hobbyist turning pro, I find your "long-winded" explanations invaluable.

I've received similar comments from users who weren't kidding (although not here (yet)), so I wasn't sure. If you're an IRC user, might I suggest #phpgolf on the FreeNode network. I think you'll find you're in good company.

Mathematica 73 65 85
Edit:
s = {}; n = 1; While[n < 50, s = Join[s, IntegerDigits[n, 2]];
Print[N[FromDigits[{s, 0}, 2], n]]; n++]

Explanation:
s holds the base-2 digits of 1, 2, 3,...n, as a list of digits, {1,1,0,1,1,1,0,0,...}. Then  FromDigits inserts the decimal point (with the 2 indicating the position), treating the input as a base-2 decimal and generating a base-10 decimal as output.

Using the built-in function: 51 chars
n=1;While[True,Print@N[ChampernowneNumber@2,n];n++]

Python, 225
import sys,fractions
w=sys.stdout.write
w('0.')
h=t=10
l=n=0
p=fractions.Fraction(5)
i=int
while 1:
 while i(h)!=i(l):
  n+=1
  for c in bin(n)[2:]:
    if c=='1':l+=p
    else:h-=p
    p/=2
 w(str(i(h)));h-=i(h);l-=i(l);h*=t;l*=t;p*=t

Note that the 4-space indentation should be tab characters.  They seem to be converted to spaces when displayed here.
Explanation
h and l are the highest and lowest possible values for the current digit, as fractions.
For example, if h is 7/2 or 3.5, the current digit is at most 3, and if it is 3, then the next digit is at most 5.
When int(h) == int(l), we know what the next digit is, so we print that, subtract it from h and l, and multiply them by 10 to get the bounds for the next digit.
When int(h) != int(l), we improve our bounds by looking further into C2.  For the nth decimal place in the output and bth binary place in C2, a 1 means l increases by 10^n/2^b and a 0 means h decreases by that amount.

GolfScript, 71 characters
1.0.){:q,{\.+)q*+\.+q*\.)3$*2$/1$4$*3$/:&-!{&10%print@10*@@}*}/q.+s}:s~

Maybe not the best puzzle for GolfScript but tried a solution anyways. The code does iterates infinitely due to an unlimited recursion and prints the digits one after the next (one of the rare cases where the print built-in is needed).
Note that the online version has a cutoff for the recursion.

Nice solution, but it seems to be missing a decimal point.


text:
Rolling three dice and show the probabilities
Roll 3 dice, count the two highest two values and add them to the result. Every 1 must be rolled once again.
Now show the average throw after 1000000 tries and the probabilities for each result occurring:
Desired Result:

avg(9.095855)
  2: 0.0023
  3: 0.0448
  4: 1.1075
  5: 2.8983
  6: 6.116
  7: 10.1234
  8: 15.4687
  9: 18.9496
  10: 19.3575
  11: 16.0886
  12: 9.8433

Are we required to throw random dice, or may we calculate the probabilities directly?

In the second sentence, do you mean "Every 1 must be rolled once again"? Yeah, I mean, I know you do, but it can be read literally as "or you can leave it if you can't be bothered" and that would result in a shorter algorithm!

Random of course, and you're right, must is more fun ;)

So, that is roll 3 dice, re-roll the 1s, take away to lowest die, sum the two, and repeat 1mil times?

Still unclear to me: what if I get a 1 and reroll it once again and get a 1 again?

Mathematica 150 146 94 115 108
Edit: This version is a suggestion from @belisarius.  Much shorter and faster than my own code (found in the earlier versions).
r=RandomInteger;t=Tr/@Rest/@Sort/@(5~r~{10^6,3}/. 0:>r[5]);
{Mean@t+2,{#[[1]]+2,#[[2]]/10^4}&/@Sort@Tally@t}//N

{9.09684, {{2., 0.0028}, {3., 0.0456}, {4., 1.1097}, {5., 2.8752}, {6., 6.1246}, {7., 10.122},
{8., 15.513}, {9., 18.8956}, {10., 19.3514}, {11., 16.074}, {12., 9.8861}}}

In 96: r=RandomInteger;{#[[1]]+2,#[[2]]/10^4}&/@Sort@Tally[Tr/@Rest/@Sort/@(5~r~{10^6,3}/. 0:>r[5])]//N

I get the following message with your code: RandomInteger::array: "The array dimensions {1000000,3\ } given in position 2 of RandomInteger[5,{1000000,3\ }] should be a list of non-negative machine-sized integers giving the dimensions for the result. "

r = RandomInteger; {#[[1]] + 2, #[[2]]/10^4} & /@    Sort@Tally[Tr /@ Rest /@ Sort /@ (5~r~{10^6, 3} /. 0 :> r[5])] // N

And then remove all the spaces except the one before the 0 in /. 0

Works. And about 10000 x faster than mine.  Why don't you submit it as your own?

Feel free to include it as an upgrade to your answer. I usually don't like answering in this site because the input/output is often required in a way more fitted to other languages.

Thanks. Yes, the formatting constraints can be a pain. BTW, I had to insert code to obtain the mean. Hence the increase in size.

APL 110 103
r←11⍴0
i←1
l:r←r+(j←1+⍳11)=+/2↑n[⍒n←3↑((3↑x)~1),3↓x←?6⍴6]
i←i+1
→(i≤k←10*6)/l
((+/r×j)÷k)
j,[1.1]r÷10*4

I have included the results of three runs to demonstrate the degree of repeatability over 1000000 iterations.
9.092186    9.093053    9.093897
  2  0.0022   2  0.0019   2  0.0023
  3  0.0442   3  0.0477   3  0.0452
  4  1.1064   4  1.0755   4  1.0866
  5  2.8808   5  2.887    5  2.8771
  6  6.1472   6  6.1864   6  6.1485
  7 10.1532   7 10.1163   7 10.1575
  8 15.6376   8 15.5511   8 15.5834
  9 18.8736   9 18.918    9 18.873
 10 19.2771  10 19.3763  10 19.3315
 11 15.9702  11 16.0225  11 16.0529
 12  9.9075  12  9.8173  12  9.8419

Very golfable. r←r+==r+←, ((3↑x)~1)==(1~⍨3↑x), 10*6==1e6, ,[1.1]==,[⍟3]

@TwiNight I am afraid all bar 1e6 will not work in an early version of APL+Win. I do not have the luxury of dynamic function either. Thanks all the same.

Python (207 194 189)
from random import*
a=lambda:randint(13,48)/7
r=range
x=[0]*13
s=0
for i in r(10**6):b=sum(sorted([a(),a(),a()])[1:]);x[b]+=1e-4;s+=b/1e6
print'avg(%f)'%s
for i in r(2,13):print`i`+':',x[i]

Algorithm:
a is the RNG, x is the list which contains the results, s is the sum. r is for code-golfing purposes.
1. Iterate through steps 2-6 1,000,000 times:
2. Get three random numbers from `a` and put them in a list.
3. Sort the list. (list is now in ascending order)
4. Take the sum of every item but the first item in the list. Call this number b.
5. Increment the (b)th index of x by 1e-4 (1/10000).
6. Increment s by b * 1e-6 (1/1000000).
7. Print out s.
8. For each item in x (excluding the first two), output the item.

APL, 67
÷1e2÷+/×/x←⍉↑n,1e4÷⍨+/(n←⊂⍳12)∘.={+/2↑x[⍒x←{⍵=1:?6⋄⍵}¨?3⍴6]}¨⍳1e6⋄x

Explanation

⍳1e6 Create array from 1 to milliion,
¨ and for each of those
{+/2↑x[⍒x←{⍵=1:?6⋄⍵}¨?3⍴6]} do a roll, re-roll 1s, and sum the high
dices:
?3⍴6 roll 3 dice,
¨ and for each die
{⍵=1:?6⋄⍵} if it is a 1, replace it by a re-roll result, else don't change it.
x← Save the result in (local) variable x,
x[⍒x...] sort it in descending order,
+/2↑ take the first 2 items (high dices) and return the sum.
+/(n←⊂⍳12)∘.= Create array of the no. of times each sum appears,
1e4÷⍨ divide by 10000,
⍉↑n, insert a row to the top with numbers 1 to 12, and matrix transpose it. The result would be something like the table in the question.
x← Save that in (global) variable x.
+/×/ Calculate the average of the million rolls by multiplying the columns, summing those...
÷1e2÷ and divide by 100.

The result is displayed (by default)

⋄x Finally, output x

Example output

9.097008
 1  0
 2  0.0028
 3  0.0466
 4  1.0914
 5  2.8873
 6  6.0957
 7 10.1242
 8 15.6108
 9 18.8688
10 19.2834
11 16.0979
12  9.8911
Notes
-5 chars if allowed to represent 10% by 0.1 instead of 10
-3 chars if allowed to use probabilistic approach (like o_o's) instead of explicit re-roll
+12 chars if the "avg()" is required
+2 chars if the "1" row needs to be removed
+8 chars if the colon is required in output

Python, 262
import random
r=random.randint
def f():n=r(1,6);return n if n>1 else r(1,6)
l=[0.0]*13
for i in range(10**6):l[sum(sorted([f(),f(),f()])[1:])]+=1
m=zip(*[range(2,13),l[2:]])
print'avg('+`sum([a*b for a,b in m])/10**6`+')'
for e in m:print`e[0]`+': '+`e[1]/10**4`

results:
avg(9.098773)
2: 0.0021
3: 0.044
4: 1.0872
5: 2.89
6: 6.0982
7: 10.133
8: 15.5
9: 18.949
10: 19.2908
11: 16.0953
12: 9.9104

Please show your results. I'm curious.

C# (599)
using System;using System.Collections.Generic;using System.Linq;namespace P{public class D{Random r=new Random(System.DateTime.Now.Millisecond);public static void Main(){var d=new D();d.G();}public int R(){return r.Next(1,7);}public int RD(){var e=new List<int>();for(var i=0;i<=2;i++){var v = R();e.Add(v != 1 ? v : R());}return e.OrderByDescending(d=>d).Take(2).Sum();}public void G(){const double l = 1000000;var t = new Dictionary<int,double>();for(var i=2;i<=12;i++)t.Add(i,0);for(var i=0;i<l;i++){var s=RD();t[s]=t[s]+1;}foreach(var a in t){Console.WriteLine(a.Key+": "+(a.Value)/10000.0);}}}}

please read http://codegolf.stackexchange.com/faq and provide a golfed version of your answer (the least you can do is have one letter variables, inline methods where possible and avoid unnecessary whitespace). Also, provide a character count in the post title.

Perl (177 169 168)
sub r{1+int rand 6}
for(1..1e6){@l=sort map{($q=r)>1?$q:r}(1..3);++$s{$y=$l[1]+$l[2]};$t+=$y}
print"avg(".$t/1e6.")\n";print"$_: ".$s{$_}/1e4."\n"for sort{$a<=>$b}keys%s

(NOTE: one-liner wrapped for clarity)
stacked output of three consecutive runs:
avg(9.09432)  avg(9.094793)  avg(9.092179)
2: 0.002      2: 0.0026      2: 0.0023
3: 0.0448     3: 0.0454      3: 0.0436
4: 1.0872     4: 1.0904      4: 1.0944
5: 2.8834     5: 2.8933      5: 2.8842
6: 6.1387     6: 6.127       6: 6.1854
7: 10.1648    7: 10.177      7: 10.1669
8: 15.498     8: 15.5758     8: 15.508
9: 18.9483    9: 18.8391     9: 18.9236
10: 19.3557   10: 19.278     10: 19.3234
11: 16.0589   11: 16.0863    11: 16.0256
12: 9.8182    12: 9.8851     12: 9.8426

UPDATES

shortening 1: eliminate $n=1e6 (insp. by Joe)
shortening 2: del space in keys %s

R - 98
S=sample
D=matrix(S(6,3e6,T),3)
D[D<2]=S(6,3e6,T)
A=colSums(D)-apply(D,2,min)
mean(A)
table(A)/1e4

Like some other answers, my output is not in the same format as the OP; I was not sure if it was a strict requirement or not:
[1] 9.095695

A
      2       3       4       5       6       7       8       9      10      11      12
 0.0018  0.0426  1.1008  2.8748  6.1438 10.1147 15.5406 18.9276 19.3525 16.0126  9.8882

TI-BASIC, not an entry
This does not meet the spec, because it doesn't show the result distribution or directly roll integers between 1 and 6, but I found a slightly clever algorithm for computing the average in one line. To get the largest two dice rolls, we pad a number larger than any of the dice rolls onto the list of three rolls, and take the median, which will be the average of the middle two numbers (two highest dice rolls). Then we just multiply by 2 to get the sum.
2ᴇ~6Σ(median(int(augment(15+36rand(3),{99})/7)),X,1,ᴇ6

Based on the speed of SuperJedi224's answer to "Death by Shock Probe", it will take over 12 hours to finish running.

LUA (307)
function r()
  m=math.random(1,6)
  if(m==1)then return math.random(1,6)end
  return m
end
e={}
s=0
o=1000000
for i=2,12 do e[i]=0 end
for t=1,o do
  d={}
  for i=1,3 do d[i]=r() end
  table.sort(d)
  x=d[2]+d[3]
  e[x]=e[x]+1
  s=s+x
end
print("avg("..s/o..")")
for i=2,12 do print(i..": "..e[i]/o*100) end

My first one ;)

You may be able to shave off some bytes by using 10^6 and by assigning random(1,6) to a function with a shorter name, such as f.

Seems to be a basic problem with the calculation and results I am seeing here.
If you must reroll the dice (all 3 or just one) when you get a 1 showing up, then the lowest possible sum of die faces you could ever have would be 4.  That is, any face that shows a 1 will be rerolled.  Which specifically requires that the lowest possible face is a 2.  You could avoid the rerolling by generating random values from 2 .. 6, but that might be missing the point.
What this means:  If you are reporting values for 2 or 3 as the sum of the faces, these are 1+1 and 2+1 respectively, the specification excludes this possibility.
That is, unless the "you must reroll the dice" only applies to the first instance of a 1.  In which case, you may have a 1+1, and 2+1 case (so you'd get sums of 2 and 3 as possible answers).

Do you have code which implements this algorithm? CG&PP is less about explaining the algorithm, and more about implementing it (in the least amount of chars possible.)

I understand this ... but the issue is that the results posted don't seem to match the specs.  If you are reporting values for sum of faces = 1, 2, or 3 in your probability calcs, you have an implementation issue that needs to be resolved.  That is, the algorithm as specified would never have a sum of faces less than 4.

You only reroll once. Basically, you have a 1/36 chance of rolling a 1, and a 7/36 chance of rolling anything else. I hope that makes it a little clearer :)

map{@f=(sort((&r,&r,&r)[1,2]));$d[$f[0]+$f[1]]++}(1..1E6);
map{$s+=$d[$_]*$_}(0..$#d);print"avg(".$s/1E6.")\n";map{print"$_:
".$d[$_]/1E4."\n"}(0..$#d);
sub r{$x=1+int(rand 6);$x>1?$x:&r}

    ~/play/golf/dice$ perl dice.pl
    avg(8.000533)
    0: 0
    1: 0
    2: 0
    3: 0
    4: 3.9796
    5: 8.0376
    6: 11.9607
    7: 16.0064
    8: 20.0094
    9: 15.9636
    10: 12.0582
    11: 8.0057
    12: 3.9788

Now a more optimized version, with a shifted RNG (no reroll), and shortened statistics calcs, also exploiting the ordering due to the ascii nature of single integers.
map{@f=(sort((&r,&r,&r)[1,2]));$i=$f[0]+$f[1];$d[$i]++;$s+=$i}(1..1E6);
print"avg(".$s/1E6.")\n";map{print"$_: ".$d[$_]/1E4."\n"}(0..$#d);
sub r{2+int(rand 5)}

As you can see, printing uses almost as much space as computing here.  If you'd like a simpler output, this would save characters.
avg(8.000901)
0: 0
1: 0
2: 0
3: 0
4: 4.0007
5: 7.9769
6: 11.9652
7: 16.0226
8: 20.0156
9: 16.0389
10: 11.9983
11: 7.9861
12: 3.9957

hey, i'll take some inspiration from you and reshuffle some code in my solution, but i'll still use a hash for statistics (whose keys i however unfortunately have to sort with explicit comparison finally), i wonder can get it shorter.. (i count   one-liner size, before wrapping).. btw, you can omit & in &r, can't? and i think you should follow the requirements exactly (rerolling 1's one), to get the statistics right.

Yes, this answer doesn't seem to fit the requirements of the question. Also, you can just edit your previous answer in-place instead of posting a completely new one. People can just click a link if they want to see what changed between edits.

Your language? your byte count? As is, this is worth a downvote

C 222 204 203
204: Updates from ugoren's comment, recycled more global vars, changed D() into a macro to save a return and three pairs of ().
203: Moved the first printf into the for to save a semicolon.
See it run in Codepad
#define D (t=rand()%6)?t:rand()%6
j,i,f[11],s,t;M(a,b,c){t=a<b?a:b;t=c<t?c:t;t=a+b+c-t;}main(){for(;j++<1e6;M(D,D,D),s+=t+2)++f[t];for(printf("avg(%f)\n",s/1e6);i<11;++i)printf("%d: %f\n",i+2,f[i]/1e4);}

#define D (t=rand()%6)?t:rand()%6
j,i,f[11],s,t;
M(a,b,c)
{
    t=a<b?a:b;
    t=c<t?c:t;
    t=a+b+c-t;
}
main()
{
    for(;j++<1e6;M(D,D,D),s+=t+2)
        ++f[t];
    for(printf("avg(%f)\n",s/1e6);i<11;++i)
        printf("%d: %f\n",i+2,f[i]/1e4);
}

avg(9.095219)
2: 0.001600
3: 0.045200
4: 1.100000
5: 2.903400
6: 6.124600
7: 10.112100
8: 15.556000
9: 18.876400
10: 19.358200
11: 16.053800
12: 9.868700
Press any key to continue . . .

Some tips: M can set t directly. Saves return. D can return (m=rand()%6)?m:rand()%6 (or with gcc - rand()%6?:rand()%6. In the first for, move something from the increment to the loop body (saves a comma). Give main a parameter (saves a comma).

Ah thanks! I was looking for ways to use a global in M() but couldn't get my head aroudn it.

Some more: In M, merge the 2nd and 3rd lines to save an assignment. In the printf, use j as 1e6. You can define main(i) and loop with ++i<13, then i runs from 2 to 12.

C - 200
I didn't bother to re-roll on 1, instead I used the probability distribution (1/36 chance of rolling 1, 7/36 chance of rolling anything else). Hopefully this is acceptable. Newline has been inserted for clarity.
#define D 6-rand()%36/7
a,b,c,t,u,w,y[13];
main(v,q){srand(q);for(;v++<=1e6;u=(a=D)<(b=D)?a:b,w+=t=a+b+(c=D)-(u<c?u:c))y[t]++;
printf("avg(%f)\n",w/1e6);for(v=1;++v<13;)printf("%d: %f\n",v,y[v]/1e4);}

After compilation (gcc -O3) - 1 run
avg(9.096896)
2: 0.002200
3: 0.043100
4: 1.093900
5: 2.891000
6: 6.110100
7: 10.091400
8: 15.605000
9: 18.936500
10: 19.258800
11: 16.047100
12: 9.920800

CoffeeScript, 146
r=()->~~(6*Math.random())
t=i=0;s=[];(a=[r()||r(),r()||r(),r()||r()].sort();t+=b=2+a[1]+a[2];s[b]=1e2/z+(s[b]||0))while++i<z=1e6;console.log t/z,s

Outputs the average and an object:
9.09456
[2: 0.0022, 3: 0.043400000000000216, 4: 1.103199999999895, 5: 2.9063000000017087, 6: 6.142699999999023, 7: 10.075099999989858, 8: 15.533299999977137, 9: 18.94439999996919, 10: 19.328099999968295, 11: 16.106199999975804, 12: 9.814999999990464]

JavaScript (ES6), 149
Algorithm is similar to my CoffeeScript answer; different syntax and semantics. I tried inlining the q function here which made no difference.
for(r=()=>~~(6*Math.random()),q=()=>r()||r(),t=i=0,s={};++i<(z=1e6);){a=[q(),q(),q()].sort();t+=b=2+a[1]+a[2];s[b]=1e2/z+(s[b]||0)}console.log(t/z,s)

Unminified
for (
    r = () => ~~ (6 * Math.random()), // function to generate random number between 0 - 5
      q = () => r() || r(),           // function to roll dice and if 0, re-roll once
      t = i = 0,                      // initialize counter and sum
      s = {};                         // initialize probability object
    ++i < (z = 1e5);                  // increment
) {
    a = [q(), q(), q()].sort();       // roll three dice and perform lexicographical sort
    t += b = 2 + a[1] + a[2];         // take two highest and add 2 since numbers are 0 - 5
    s[b] = 1e2 / z + (s[b] || 0)      // put into probability object as a percent
}
console.log(t / z, s)                 // STDOUT