Iterated digits squaring: Difference between revisions

Added Befunge example.
m (C# fixed output window)
(Added Befunge example.)
Line 151:
Version 2: 85744333 in 718.04 seconds.
Version 3: 85744333 in 0.02 seconds.</pre>
 
=={{header|Befunge}}==
 
This is just a brute force solution, so it's not very fast. A decent interpreter will probably take a minute or two for a 1,000,000 iterations. If you want to test with 100,000,000 iterations, change the <tt>::**</tt> (100³) near the end of the first line to <tt>:*:*</tt> (100²<sup>²</sup>). With that many iterations, though, you'll almost certainly want to be using a compiler, otherwise you'll be waiting a long time for the result.
 
<lang befunge>1-1\10v!:/+55\<>::**>>-!|
v0:\+<_:55+%:*^^"d":+1$<:
>\`!#^ _$:"Y"-#v_$\1+\:^0
>01-\0^ @,+55.<>:1>-!>#^_
>,,,$." >=",,,^ >>".1">#<</lang>
 
{{out}}
 
<pre>1..1000000 => 856929</pre>
 
<pre>1..100000000 => 85744333</pre>
 
=={{header|C}}==
Anonymous user