Jump to content

Cantor set: Difference between revisions

m
→‎{{header|REXX}}: added whitespace, changed some comments.
No edit summary
m (→‎{{header|REXX}}: added whitespace, changed some comments.)
Line 2,197:
<lang rexx>/*REXX program displays an ASCII diagram of a Canter Set as a set of (character) lines. */
w= linesize() /*obtain the width of the display term.*/
if w==0 then w=81 81 /*Can't obtain width? Use the default.*/
do lines=0; _ = 3 ** lines /*calculate powers of three (# lines).*/
if _>w then leave /*Too large? We passed the max value. */
#=_ /*this value of a width─of─line is OK. */
Line 2,205:
$= copies('■', #) /*populate the display line with blocks*/
do j=0 until #==0 /*show Cantor set as a line of chars. */
if j>0 then do k=#+1 by #+# to w /*skip 1st line blanking.*/
$= overlay( left('', #), $, k) /*blank parts of a line. */
end /*j*/
say $ /*display a line of the Cantor Set. */
Cookies help us deliver our services. By using our services, you agree to our use of cookies.