Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The Prime Bubble rolls a 6, meaning that the Cascader will iterate six times
- #1: We always start with a 6 sided die, and it rolls a 2, so the next die has 6x2=12 sides
- #2: The 12 sided die rolls an 8, meaning that the third die has 12x8=96 sides
- #3: The 96 sided die rolls a 35, meaning that die 4 has 96x35=3360 sides
- #4: The 3360 sided die rolls a 2290, so die 5 has 3360x2290 = 9,817,920 sides
- #5: The 9.8 million sided die rolls a 5,101,894, so the final die has 50,090,870,753,280 sides
- #6: The 50 trillion sided die rolls a one. Hooray.
- Since the last die rolled gave a 1, your function or program should output 1.
- The Prime Bubble rolls a 2, meaning that the Cascader will iterate twice.
- #1: We always start with a 6 sided die, and it rolls a 4, so the next die has 6x4 = 24 sides
- #2: The 24 sided die rolls a 14
- Since the last die rolled gave a 14, your function or program should output 14.
- (*1+?)^:(?`])@6
- *|{x,1+1?x:(*).x}/[*a;6,a:1+1?6]
- *|{x,1+1?x:(*).x}/[*a;6,a:1+1?6] / the solution
- { }/[n; c ] / iterate over lambda n times with starting condition c
- 1?6 / 1 choose 6, between 0..5 (returns a list of 1 item)
- 1+ / add 1 (so between 1..6)
- a: / store as 'a'
- 6, / prepend 6, the number of sides of the first dice
- *a / we are iterating between 0 and 5 times, take first (*)
- (*).x / multi-argument apply (.) multiply (*) to x, e.g. 6*2 => 12
- x: / save that as 'x'
- 1? / 1 choose x, between 0..x-1
- 1+ / add 1 (so between 1..x)
- x, / prepend x
- *| / reverse-first aka 'last'
- (6 3 / 1 choose 6 => 3, so perform 3 iterations
- 18 15 / 1 choose (6*3=18) => 15
- 270 31 / 1 choose (18*15=270) => 31
- 8370 5280) / 1 choose (270*31=8730) => 5280
- X6DLΩF*DLΩ
- 6×X$6X’¤¡X
- ¤ | Following as a nilad:
- 6X | - A random number between 1 and 6
- ’ | - Decrease by 1 (call this N)
- 6 | Now, start with 6
- $ ¡ | Repeat the following N times, as a monad
- × | - Multiply by:
- X | - A random number between 1 and the current total
- X | Finally, generate a random number between 1 and the output of the above loop
- (r=RandomInteger)@{1,Nest[r@{1,#}#&,6,r@5]}
- 6X×$5СXX
- 6X×$5СXX - Link: no arguments
- 6 - initialise left argument to 6
- 5С - repeat five times, collecting up as we go: -> a list of 6 possible dice sizes
- $ - last two links as a monad = f(v): e.g [6,18,288,4032,1382976,216315425088]
- X - random number in [1,v] or [6,6,6,6,6,6]
- × - multiply (by v) or [6,36,1296,1679616,2821109907456,7958661109946400884391936]
- X - random choice (since the input is now a list) -> faces (on final die)
- X - random number in [1,faces]
- ⊞υ⁶F⊕‽⁶⊞υ⊕‽ΠυI⊟υ
- ⊞υ⁶
- F⊕‽⁶
- ⊞υ⊕‽Πυ
- I⊟υ
- ≔⁶θF‽⁶≧×⊕‽θθI⊕‽θ
- ≔⁶θ
- F‽⁶
- ≧×⊕‽θθ
- I⊕‽θ
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement