g | x | w | all
Bytes Lang Time Link
094Java 8171110T151020ZKevin Cr
01305AB1E180809T134633ZKevin Cr
081Python240429T160002Zmovatica
053Perl 5240429T151218ZXcali
012Vyxal240429T020802Zemanresu
058MATLAB180808T171526Zaaaaa sa
052R131217T172304ZSven Hoh
067R180808T124545ZJayCe
071><>151005T133645ZAaron
016GS2151005T061816Zrecursiv
034TIBASIC150704T184402Zlirtosia
026GolfScript131217T152443ZHoward
028GolfScript110220T000709ZJoey
071QBasic110219T020053ZPleaseSt
030J110215T233507ZJ B
044Ruby110218T231246Zsteensla
nan110218T123906ZLars Hau
nan110215T234554ZEelvex
045Windows PowerShell110218T105723ZJoey
087Bash110216T102622ZPeter Ta
096Bash with only one loop110216T120743ZPeter Ta
nan110216T014317ZAman Zee
071JavaScript110215T231226ZPleaseSt

Java 8, 130 95 94 bytes

v->{long d=9,p,r=0;for(;r<1e9;r=r*10+d--)for(p=d;p==d++|p+d==7;d*=Math.random())d=6;return r;}

-1 byte thanks to @emanresuA.

Try it online.

As full program with verbose main-method and printing the dice-rolls directly would be 178 132 bytes instead (for explanation, see edit history of 95 bytes version):

interface M{static void main(String[]a){for(int d=9,p,i=10;i-->0;System.out.print(d--))for(p=d;p==d++|p+d==7;d*=Math.random())d=6;}}

Try it online.

Explanation:

v->{               // Method with empty unused parameter and long return-type
  long d=9,        //  Random dice integer, starting at 9
                   //  (initially, any value outside range [0,6] for `d` is fine)
      p,           //  Previous dice-roll, starting uninitialized
      r=0;         //  Result-long, starting at 0
  for(;r<1e9       //  Loop as long as the result is not 10 digits yet:
      ;            //    After every iteration:
       r=          //     Update the result to:
         r*10+d    //      Multiply by 10 and add the dice-roll
                   //      (aka, append the dice-roll to the result-long)
               --) //     And decrease `d` by 1 afterwards with `d--`
    for(p=d;       //   Set `p` to the current `d`
        p==d       //   Inner loop as long as `p` is still equal to `d`
            ++     //   And increase `d` by 1 afterwards with `d++`
        |          //   Or
         p+d==7    //   As long as `p` and `d` combined equals 7
                   //   (aka `p` and `d` are at opposite sides of the dice)
      d*=Math.random())d=6;}
                   //    Do a random 'dice roll' in the range [0,6)
                   //    (which is why we've did `d++` in the loop-condition)
  return r;}       //  After the loops, return the result-long

05AB1E, 23 13 bytes

TF6LsD7α‚KΩD?

Try it online.

If outputting newline-delimited instead of concatenated is allowed, it could be 1 byte less by replacing the D? with =:
Try it online.

Explanation:

TF             # Loop 10 times:
  6L           #  Push list [1,2,3,4,5,6]
    s          #  Swap the top two values on the stack (in the first iteration,
               #  it'll push an additional copy of the list)
     D         #  Duplicate this value/list
      7α       #  Get the absolute difference with 7
        ‚      #  Pair the two together
         K     #  Remove those two values from the list
               #  (pop + no-op for the pair of lists in the first iteration)
          Ω    #  Pop and push a random item from this list
           D?  #  Duplicate, pop and output it without newline

Python, 87 81 bytes

-6 bytes by emanresu A

from random import*
p=0
for _ in'x'*10:print(p:=choice([*{1,2,3,4,5,6}-{p,7-p}]))

Attempt This Online!

Perl 5, 53 bytes

say map$b=(grep$_+$b-7&&$_-$b,1..6)[rand!$b*2+4],0..9

Try it online!

Vyxal, 12 bytes

₀(:7ε"6ɾ$F℅…

Try it Online!

₀(           # Ten times
           … # Print
          ℅  # A random item of
      6ɾ     # [1...6]
        $F   # Without
  :7ε"       # [prev,7-prev] (stack is padded with zeros)

MATLAB 58 bytes

a=randi(6)
for i=1:9;b=1:6;b([a,7-a])=[];a=b(randi(4))
end

R, 56 52

for(i in 0:9)cat(F<-sample(setdiff(1:6,c(F,7-F)),1))

R, 67 bytes

c(3,5,1,4,2,6)[(sample(1:6,1)+cumsum(sample((-2:2)[-3],9,T)))%%6+1]

Try it online!

There is a golfier R answer but this I think is a different approach from the answers submitted so far.

c(3,5,1,4,2,6)                                                     #A dice and its facets
               (sample(1:6,1)                                      #Initial dice roll
                             +cumsum(sample((-2:2)[-3],9,T)))      #9 tippings in c(-2,-1,1,2)
                                                             %%6+1 #converts to values in [0,6]
              [                                                   ]#

><>, 71 bytes

I'm glad I could showcase ><>'s x code-pointer randomization as I don't recall seeing it here.

a&0 v
 /2v
1x3v 
>x< <<
6x4v
 \5v ~
:{:/ ^?=}
:{:/ ^?=7+}
:~$<^&;!?:-1&n

You can try it on this online interpreter (paste code, submit, start).

GS2, 16 bytes

16 2f 25 08 41 20 17 30 16 2f 31 31 25 09 19 32

Here's how it works

16 2f 25     # make range from 1 to 6 and push random element
08           # start block
    41       # duplicate top of stack twice
    20 17 30 # negate top of stack and add 7
    16 2f    # push range from 1 to 6
    31 31    # do set-wise difference with each of the two previous numbers
    25       # push a random element from the list
09           # end block
19 32        # repeat block 9 times

TI-BASIC, 38 34

For(I,1,9
Ans→X
Repeat Ans≠X and Ans≠7-X
randInt(1,6
End
Disp Ans
End

Boring solution, but it's shorter than the previous revision. I take advantage of the fact that on a fresh calculator, Ans is initialized to zero.

GolfScript, 26 chars

0{(.6,5@--\-.,rand=).}10*;

A slight more compressed version of Joey's, basically working around the issue with zero-indexing.

GolfScript, 28

0:|;{7,[0|7|-]-.,rand=:|}10*

QBasic (71 characters)

The two newlines are necessary and included in the character count as one character each.

RANDOMIZE:FOR I=0TO 9
1N=INT(RND*6)+1:IF L=N OR L+N=7THEN 1
?N:L=N:NEXT

J, 30 characters

>:(?@4:{(i.6)-.],5&-)^:(<10)?6

6 2 3 5 4 2 4 1 3 6

Explanations (read from right to left):

Ruby, 44

c=0;10.times{$><<c=([*1..6]-[c,7-c]).sample}

I found the [*1..6] trick by lucky experimenting.

Ruby

66 characters

(0..9).reduce([]){|m|m<<((1..6).to_a-[d=m[-1]||0,7-d]).shuffle[0]}

J

This should work but unfortunately J's random generator gets stuck after the 3rd iteration:

a=:>:i.6
f=:a#~1-(+&(a=])7&-)
((,(?4)&{@f@(_1&{))^:9)>:?6

6 4 5 4 5 4 5 4 5 4

Windows PowerShell, 45

-join(0..9|%{($d=1..6-ne(7-$d)-ne$d|random)})

Pretty trivial, actually. I generate a list of possible dice rolls 1..6 and then select only those not equal to seven minus the last roll and then only those not equal to the last roll. From the remaining list I then select a random item and assign it to $d. Since $d is initially treated as 0 it rolls a normal die the first time.

Test script:

for($i=0;$i-lt20;$i++){
    $o=@(./tipping.ps1)
    if ($i-gt0-and$o-eq$o2) { throw "Must have random output" }
    if ($o.count-ne1) { throw "Must only have one line of output" }
    if ($o[0]-match'[^1-6]'){ throw "Invalid characters" }
    if($o[0].length-ne10){ throw "Wrong length: $($o[0].length)" }
    $r=[char[]]($o[0])|%{$_-48}
    for ($x=1;$x-lt$r.count;$x++){
        if ($r[$x-1]+$r[$x]-eq7) { throw "Not a tipping: $($r[$x-1]) and $($r[$x])" }
    }
    $o2=$o
}

History:

Bash: 97 94 92 90 89 87

Heavily golfed from Aman ZeeK Verma's answer:

for((i=10,f=0;i--;))do
for((n=f;n==f||n+f==7;f=RANDOM%6+1))do :
done
printf $f
done

http://ideone.com/QiuTx

NB arguably it can be shrunk by 5 chars by changing the first line to for((;i++<10;)) but that makes assumptions which aren't always valid. It would work ok in ideone but someone running it from a shell could have i or f exported to something non-zero.

Bash with only one loop: 100 99 98 96

for((i=10,f=RANDOM%6+1;i--;))do
printf $f
((n=RANDOM%4+1,m=f<4?f:7-f,f=n<m||++n<7-m?n:n+1))
done

http://ideone.com/XrZO7

The key idea is that to pick a random number in [1,x] which isn't equal to y you can pick a random number in [1,x-1] and then increment if it's >= y. For this problem we want a random number in [1,6] which isn't equal to f or 7-f. We have to do the two tests in order min(f,7-f), max(f,7-f).

Assuming an initially empty environment could save 2 chars by not initialising i and changing the loop condition to i++<10

Bash

#/!bin/bash
f=`expr $RANDOM % 6` 
f=`expr $f + 1`
printf "$f"
for ((i=0; i<9; i++))
do
   ((bad=7-$f))
   next=`expr $RANDOM % 6`
   next=`expr $next + 1`
   while [ $next -eq $bad ] || [ $next -eq $f ]
   do
      next=`expr $RANDOM % 6`
      next=`expr $next + 1`
   done
printf "$next"
f=$next
done

sample code: http://ideone.com/CCfro

JavaScript (71 characters)

You may need to replace print with alert or something else, depending on your JavaScript environment.

for(C=L=T=0;C++<10;print(L=T))while(!(T-L&&T+L-7))T=Math.random()*6+1|0