combinators.random: fix a couple of usage examples in casep and casep*
parent
5a71a0d671
commit
70d06dc4c7
|
@ -32,17 +32,21 @@ HELP: casep
|
||||||
{ $examples
|
{ $examples
|
||||||
"The following two forms will output 1 with 0.2 probability, 2 with 0.3 probability and 3 with 0.5 probability"
|
"The following two forms will output 1 with 0.2 probability, 2 with 0.3 probability and 3 with 0.5 probability"
|
||||||
{ $code
|
{ $code
|
||||||
"USING: combinators.random ;"
|
"USING: combinators.random prettyprint ;"
|
||||||
"{ { 0.2 [ 1 ] }"
|
"{"
|
||||||
|
" { 0.2 [ 1 ] }"
|
||||||
" { 0.3 [ 2 ] }"
|
" { 0.3 [ 2 ] }"
|
||||||
" { 0.5 [ 3 ] } } casep ."
|
" { 0.5 [ 3 ] }"
|
||||||
|
"} casep ."
|
||||||
}
|
}
|
||||||
$nl
|
$nl
|
||||||
{ $code
|
{ $code
|
||||||
"USING: combinators.random ;"
|
"USING: combinators.random prettyprint ;"
|
||||||
"{ { 0.2 [ 1 ] }"
|
"{"
|
||||||
|
" { 0.2 [ 1 ] }"
|
||||||
" { 0.3 [ 2 ] }"
|
" { 0.3 [ 2 ] }"
|
||||||
" { [ 3 ] } } casep ."
|
" [ 3 ]"
|
||||||
|
"} casep ."
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -62,17 +66,21 @@ HELP: casep*
|
||||||
{ $examples
|
{ $examples
|
||||||
"The following two forms will output 1 with 0.5 probability, 2 with 0.25 probability and 3 with 0.25 probability"
|
"The following two forms will output 1 with 0.5 probability, 2 with 0.25 probability and 3 with 0.25 probability"
|
||||||
{ $code
|
{ $code
|
||||||
"USING: combinators.random ;"
|
"USING: combinators.random prettyprint ;"
|
||||||
"{ { 0.5 [ 1 ] }"
|
"{"
|
||||||
|
" { 0.5 [ 1 ] }"
|
||||||
" { 0.5 [ 2 ] }"
|
" { 0.5 [ 2 ] }"
|
||||||
" { 1 [ 3 ] } } casep* ."
|
" { 1 [ 3 ] }"
|
||||||
|
"} casep* ."
|
||||||
}
|
}
|
||||||
$nl
|
$nl
|
||||||
{ $code
|
{ $code
|
||||||
"USING: combinators.random ;"
|
"USING: combinators.random prettyprint ;"
|
||||||
"{ { 0.5 [ 1 ] }"
|
"{"
|
||||||
|
" { 0.5 [ 1 ] }"
|
||||||
" { 0.5 [ 2 ] }"
|
" { 0.5 [ 2 ] }"
|
||||||
" { [ 3 ] } } casep* ."
|
" [ 3 ]"
|
||||||
|
"} casep* ."
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue