Anonymous user
Fractran: Difference between revisions
Added Befunge example.
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: Add referenced code to make a runnable block) |
(Added Befunge example.) |
||
Line 386:
Press any key to continue . . .</pre>
=={{header|Befunge}}==
This takes as input a space-separated list of fractions, a starting value, and the number of iterations to output.
Note that in some interpreters you may need to press <Return> twice after entering the fractions if the ''Starting value'' prompt doesn't at first appear.
<lang befunge>p0" :snoitcarF">:#,_>&00g5p~$&00g:v
v"Starting value: "_^#-*84~p6p00+1<
>:#,_&0" :snoitaretI">:#,_#@>>$&\:v
:$_\:10g5g*:10g6g%v1:\1$\$<|!:-1\.<
g0^<!:-1\p01+1g01$_10g6g/\^>\010p00</lang>
{{out}}
<pre>Fractions: 17/91 78/85 19/51 23/38 29/33 77/29 95/23 77/19 1/17 11/13 13/11 15/14 15/2 55/1
Starting value: 2
Iterations: 16
2 15 825 725 1925 2275 425 390 330 290 770 910 170 156 132 116</pre>
=={{header|Bracmat}}==
|