Handbook
Glossary
ifp ( p true false -- )
Random combinators
Next:
whenp ( p true -- )
Vocabulary
combinators
.
random
Inputs
p
a number between 0 and 1
true
a
quotation
false
a
quotation
Outputs
None
Word description
Calls the
true
quotation with probability
p
and the
false
quotation with probability (1-
p
).
Definition
USING:
kernel
math
random
;
IN:
combinators.random
:
ifp
( p true false -- )
[
random-unit
>
]
2dip
if
;
inline