Elementary cellular automaton/Random number generator: Difference between revisions

Realize in F#
m (→‎{{header|Pascal}}: counting cpu-cycles on TryItOnline via RDTSC , only 3.2 GHZ on Ryzen)
(Realize in F#)
Line 151:
Run-time: less than two seconds with the ldc2 compiler.
 
=={{header|F_Sharp|F#}}==
This task uses [[Elementary cellular automaton#The_Function]]
<lang fsharp>
// Generate random numbers using Rule 30. Nigel Galloway: August 1st., 2019
eca 30 [|yield 1; yield! Array.zeroCreate 99|]|>Seq.map(fun n->n.[0])|>Seq.chunkBySize 8|>Seq.map(fun n->Array.mapi(fun n g->g<<<(7-n)) n|>Array.sum)|>Seq.take 10|>Seq.iter(printf "%d "); printfn ""
</lang>
{{out}}
<pre>
220 197 147 174 117 97 149 171 240 241
</pre>
=={{header|Go}}==
{{trans|C}}
2,171

edits