Floyd's triangle: Difference between revisions

Content added Content deleted
(→‎{{header|Run BASIC}}: Marked incorrect)
(add Forth)
Line 517:
92 93 94 95 96 97 98 99 100 101 102 103 104 105</pre>
 
=={{header|FORTRANForth}}==
<lang forth>: lastn ( rows -- n ) dup 1- * 2/ ;
: width ( n -- n ) s>f flog ftrunc f>s 2 + ;
 
: triangle ( rows -- )
dup lastn 0 rot ( last 0 rows )
0 do
over cr
i 1+ 0 do
1+ swap 1+ swap
2dup width u.r
loop
drop
loop
2drop ;
</lang>
 
=={{header|Fortran}}==
 
Please find compilation instructions on GNU/linux system at the beginning of the source. There, also, are the example output triangles produced by running the program. The environment variable setting and command line argument are vestigial. Ignore them. The code demonstrates writing to an in memory buffer, an old feature of FORTRAN.