RosettaCodeData/Task/Linear-congruential-generator/Oforth/linear-congruential-generator.oforth
2016-12-05 23:44:36 +01:00

4 lines
130 B
Text

: genLCG(a, c, m, seed)
| ch |
Channel newSize(1) dup send(seed) drop ->ch
#[ ch receive a * c + m mod dup ch send drop ] ;