Colour bars/Display: Difference between revisions

m
→‎{{header|REXX}}: changed/added comments and whitespace, changed indentations.
No edit summary
m (→‎{{header|REXX}}: changed/added comments and whitespace, changed indentations.)
Line 858:
{{works with|R4}}
{{works with|ROO}}
Programming note:   because of the way the REXX interpreters (being used for this example) ensure screen output fidelity, if ninety characters are displayed on a ninety-byte wide screen, REXX apparently forces an extra blank, causing to what appears to be a blank line after the line displayed.   Because of this, the last color bar   ('''_.8''')   has been shortened by one byte.
 
<br>
<lang rexx>/*REXX program displays eight colored vertical bars on the full screen. */
Programming note: &nbsp; because of the way the REXX interpreters &nbsp; (being used for this example) &nbsp; ensure screen output fidelity, &nbsp; if ninety characters are displayed on a ninety-byte wide screen, &nbsp; REXX apparently forces an extra blank, &nbsp; causing to what appears to be a blank line after the line displayed. &nbsp; Because of this, &nbsp; the last color bar &nbsp; ('''_.8''') &nbsp; has been shortened by one byte.
parse value scrsize() with sd sw . /*screen depth,width.*/
 
barWidth=sw%8 /*calculate bar width*/
_.=copies('db'x,barWidth)<lang rexx>/*REXX program displays eight colored vertical bars on a full screen. /*the bar, full width*/
_.8=left(_.,barWidth-1) parse value scrsize() with sd sw . /*lastthe barscreen depth and width. */
barWidth=sw%8 /*calculate the bar width. */
$ = x2c('1b5b73') || x2c('1b5b313b33376d') /* preamble, header. */
hdr_.1 = x2ccopies('1b5b303b33306ddb'x, barWidth) /* the colorbar, blackfull width. */
hdr_.2 8= x2cleft('1b5b313b33316d'_.,barWidth-1) /* the colorlast red.bar width, less one. */
hdr.3 $ = x2c('1b5b313b33326d1b5b73') || x2c("1b5b313b33376d") /* the preamble, /*and the color greenheader. */
hdr.41 = x2c('1b5b313b33346d1b5b303b33306d') /* the " color blueblack. */
hdr.52 = x2c('1b5b313b33356d1b5b313b33316d') /* the " color magentared. */
hdr.63 = x2c('1b5b313b33366d1b5b313b33326d') /* the " color cyangreen. */
hdr.74 = x2c('1b5b313b33336d1b5b313b33346d') /* the " color yellowblue. */
hdr.85 = x2c('1b5b313b33376d1b5b313b33356d') /* the " color whitemagenta. */
hdr.6 = x2c('1b5b313b33366d') /* " color cyan. */
tail = x2c('1b5b751b5b303b313b33363b34303b306d') /* epilogue, trailer.*/
hdr.7 = x2c('1b5b313b33336d') /* " color yellow. /* [↓] last bar width is shrunk.*/
hdr.8 = x2c('1b5b313b33376d') do j=1 for 8 /*build the line," color by color white. */
tail = x2c('1b5b751b5b303b313b33363b34303b306d') /* " epilogue, and the trailer.*/
$=$ || hdr.j || _.j /*append the color header + bar. */
end /*j*/ /* [] colorlast orderbar iswidth theis listshrunk. */
do j=1 for 8 /* [↓] the tail is overkill./*build the line, color by color. */
$=$ || tailhdr.j || _.j /*append the epiloguecolor (trailer)header + bar. */
end /*j*/ /* [] showcolor fullorder screenis ofthe barslist. */
do k=1 for sd /*SD =[↓] screen depththe (fromtail above)is overkill. */
$=$ || tail say $ /*haveappend REXXthe displayepilogue line(trailer). of bars.*/
end /*k*/ /* [] Note:show full SDscreen of couldbars. be zero.*/
do k=1 for sd /*stickSD a= forkscreen indepth it,(from we're doneabove). */</lang>
say $ /*have REXX display line of bars. */
'''output''' appears identical to the output for &nbsp; '''Icon and Unicon''', &nbsp; '''Mathematica''', &nbsp; and &nbsp; '''R''' &nbsp; examples.
end /*k*/ /* [↑] Note: SD could be zero. */
/*stick a fork in it, we're done. */</lang>
'''output''' &nbsp; appears identical to the output for &nbsp; '''Icon and Unicon''', &nbsp; '''Mathematica''', &nbsp; and &nbsp; '''R''' &nbsp; examples.
 
=={{header|Ring}}==