Spec-Zone.ru › Pony

Dice

[Source]

A simple dice roller.

class ref Dice

Constructors

create

[Source]

Initialise with a random number generator.

new ref create(
  from: Random ref)
: Dice ref^

Parameters

  • from: Random ref

Returns

  • Dice ref^

Public fields

var r: Random ref

[Source]

Public Functions

apply

[Source]

Return the sum of count rolls of a die with the given number of sides. The die is numbered from 1 to sides. For example, count = 2 and sides = 6 will return a value between 2 and 12.

fun ref apply(
  count: U64 val,
  sides: U64 val)
: U64 val

Parameters

  • count: U64 val
  • sides: U64 val

Returns

  • U64 val

© 2016-2020, The Pony Developers
© 2014-2015, Causality Ltd.
Licensed under the BSD 2-Clause License.
https://stdlib.ponylang.io/random-Dice

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API