fork download
  1. open System
  2.  
  3. type Int32 with
  4. static member rng = new Random()
  5. member x.d y =
  6. List.sum [for i in 1 .. x -> Int32.rng.Next (1, y + 1)]
  7.  
  8. //"2d6 = " + (2.d 6 |> string) |> Console.WriteLine // error
  9. "2d6 = " + (2 .d 6 |> string) |> Console.WriteLine
Success #stdin #stdout 0.05s 24072KB
stdin
Standard input is empty
stdout
2d6 = 7