Fractran: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: added whitespace and changed some comments, used templates for the output sections.)
m (→‎{{header|REXX}}: added whitespace in a couple of comparisons.)
Line 2,778: Line 2,778:
do j=1 for terms /*perform the DO loop for each term. */
do j=1 for terms /*perform the DO loop for each term. */
do k=1 for # /* " " " " " " fraction*/
do k=1 for # /* " " " " " " fraction*/
if N//d.k\==0 then iterate /*Not an integer? Then ignore it. */
if N // d.k \== 0 then iterate /*Not an integer? Then ignore it. */
say right('term' j, 35) "──► " N /*display the Nth term with the N. */
say right('term' j, 35) "──► " N /*display the Nth term with the N. */
N= N % d.k * n.k /*calculate next term (use %≡integer ÷)*/
N= N % d.k * n.k /*calculate next term (use %≡integer ÷)*/
Line 2,920: Line 2,920:
do j=1 for abs(terms) /*perform DO loop once for each term. */
do j=1 for abs(terms) /*perform DO loop once for each term. */
do k=1 for # /* " " " " " " fraction*/
do k=1 for # /* " " " " " " fraction*/
if N//d.k\==0 then iterate /*Not an integer? Then ignore it. */
if N // d.k \== 0 then iterate /*Not an integer? Then ignore it. */
if tell then say right('term' j, 35) "──► " N /*display Nth term and N.*/
if tell then say right('term' j, 35) "──► " N /*display Nth term and N.*/
else if !.N then say right('term' j,15) "──►" @.N q right(L,w)") " N
else if !.N then say right('term' j,15) "──►" @.N q right(L,w)") " N