Sisyphus sequence: Difference between revisions

Content added Content deleted
m (→‎{{header|Wren}}: Changed to Wren S/H)
 
Line 1,519: Line 1,519:


Extreme stretch not attempted and out of reasonable reach for Wren-CLI.
Extreme stretch not attempted and out of reasonable reach for Wren-CLI.
<syntaxhighlight lang="ecmascript">import "./math" for Int, Nums
<syntaxhighlight lang="wren">import "./math" for Int, Nums
import "./fmt" for Fmt
import "./fmt" for Fmt


Line 1,597: Line 1,597:


The following script manages to find the first occurrence of the number 36 in the sequence in about 2 hours 54 minutes which (relative to Phix) is much quicker than one would normally expect. This is probably due to the heavy lifting (i.e. the prime generation) being done here in both cases by C++ though this will tempered by the need to convert unsigned 64-bit integers to doubles (Wren's only numeric type) for each prime generated.
The following script manages to find the first occurrence of the number 36 in the sequence in about 2 hours 54 minutes which (relative to Phix) is much quicker than one would normally expect. This is probably due to the heavy lifting (i.e. the prime generation) being done here in both cases by C++ though this will tempered by the need to convert unsigned 64-bit integers to doubles (Wren's only numeric type) for each prime generated.
<syntaxhighlight lang="ecmascript">import "./psieve" for Primes
<syntaxhighlight lang="wren">import "./psieve" for Primes
import "./fmt" for Fmt
import "./fmt" for Fmt