Skip to main content
Added explanation
Source Link
Sok
  • 6.2k
  • 1
  • 17
  • 30

Pyth, 14 bytes

uhO=*|Z6GO6hO6

Try it online!

uhO=*|Z6GO6hO6   
         O6      Random number in range [0-6)
u                Perform the following the above number of times...
           hO6   ... with starting value G a random number in range [1-6]:
    *   G          Multiply G with...
     |Z6           The value of Z, or 6 if it's the first time through (Z is 0 at program start)
   =  Z            Assign the above back into Z
  O                Random number in range [0-Z)
 h                 Increment
                 Implicit print result of final iteration

Pyth, 14 bytes

uhO=*|Z6GO6hO6

Try it online!

Pyth, 14 bytes

uhO=*|Z6GO6hO6

Try it online!

uhO=*|Z6GO6hO6   
         O6      Random number in range [0-6)
u                Perform the following the above number of times...
           hO6   ... with starting value G a random number in range [1-6]:
    *   G          Multiply G with...
     |Z6           The value of Z, or 6 if it's the first time through (Z is 0 at program start)
   =  Z            Assign the above back into Z
  O                Random number in range [0-Z)
 h                 Increment
                 Implicit print result of final iteration
Source Link
Sok
  • 6.2k
  • 1
  • 17
  • 30

Pyth, 14 bytes

uhO=*|Z6GO6hO6

Try it online!