Paste: rolling dice

Author: koltar
Mode: factor
Date: Wed, 25 Jan 2012 20:52:22
Plain Text |
USING: random ;

: roll-die ( sides -- n )  random 1 + ;
: roll-dice ( dice sides -- n )
    <array> [ roll-die ] [ + ] map-reduce ;

Annotation: without <array>

Author: koltar
Mode: factor
Date: Wed, 25 Jan 2012 21:29:52
Plain Text |
: roll-dice ( dice sides -- n )
    <repetition> [ roll-die ] [ + ] map-reduce ;

New Annotation

Summary:
Author:
Mode:
Body: