function randomizeAreaX(line, col, lines, cols) {
    //
    const colEnd = Math.min(col + cols, COLUMNS)
    const randomByte = () => Math.floor(Math.random() * 256)
    //
    // randomize the colour attributes on one line
    for (let c = col; c < colEnd; c++)
        displayColours[line * COLUMNS + c] = randomByte()
    //
    // copy colour attributes to following lines
    const l0 = (line + 1) * COLUMNS + col
    const lZ = Math.min(line + lines, LINES)
    for (let l = l0; l < lZ * COLUMNS; l += COLUMNS) {
        const start = line * COLUMNS + col
        const end = start + cols
        displayColours.copyWithin(l, start, end)
    }
    // create some random pixels
    const y0 = line * COLUMNS * CHARSIZE
    for (let c = col; c < colEnd; c++)
        displayPixels[y0 + c] = randomByte()
    //
    // copy the random pixels to other lines
    const yEnd = Math.min(line + lines, LINES) * COLUMNS * CHARSIZE
    for (let y = y0 + COLUMNS + col; y < yEnd; y += COLUMNS)
        displayPixels.copyWithin(y, y0 + col, y0 + colEnd)
} //                                                              randomizeAreaX

/** randomizeAreaX():
 *  Randomizes the specified area of the virtual display.
 *  The area will contain random pixels and colours along the X-axis.
 *
 *  @param [line]   Starting line number, a number from 0 to LINES-1.
 *                  The starting line is at the top of the display.
 *
 *  @param [col]    Starting column number, a number from 0 to COLUMNS-1.
 *                  The starting column is at the left of the display.
 *
 *  @param [lines]  The height of the area to update, from 1 to LINES.
 *                  Any areas out of the display area will be ignored.
 *
 *  @param [cols]   The width of the area to update, from 1 to COLUMNS.
 */
Randomizes the specified area of the virtual display.
The area will contain random pixels and colours along the X-axis.

@param [line]   Starting line number, a number from 0 to LINES-1.
The starting line is at the top of the display.

@param [col]    Starting column number, a number from 0 to COLUMNS-1.
The starting column is at the left of the display.

@param [lines]  The height of the area to update, from 1 to LINES.
Any areas out of the display area will be ignored.

@param [cols]   The width of the area to update, from 1 to COLUMNS.
Randomizes the specified area of the virtual display . The area will contain random pixels and colours along the X - axis . @param [ line ] Starting line number a number from 0 to LINES - 1 . The starting line is at the top of the display . @param [ col ] Starting column number a number from 0 to COLUMNS - 1 . The starting column is at the left of the display . @param [ lines ] The height of the area to update from 1 to LINES . Any areas out of the display area will be ignored . @param [ cols ] The width of the area to update from 1 to COLUMNS .
function randomizeAreaX(line, col, lines, cols) {
    const colEnd = Math.min(col + cols, COLUMNS)
    const randomByte = () => Math.floor(Math.random() * 256)
    for (let c = col; c < colEnd; c++)
        displayColours[line * COLUMNS + c] = randomByte()
    const l0 = (line + 1) * COLUMNS + col
    const lZ = Math.min(line + lines, LINES)
    for (let l = l0; l < lZ * COLUMNS; l += COLUMNS) {
        const start = line * COLUMNS + col
        const end = start + cols
        displayColours.copyWithin(l, start, end)
    }
    const y0 = line * COLUMNS * CHARSIZE
    for (let c = col; c < colEnd; c++)
        displayPixels[y0 + c] = randomByte()
    const yEnd = Math.min(line + lines, LINES) * COLUMNS * CHARSIZE
    for (let y = y0 + COLUMNS + col; y < yEnd; y += COLUMNS)
        displayPixels.copyWithin(y, y0 + col, y0 + colEnd)
} 
function randomizeAreaX ( line , col , lines , cols ) { const colEnd = Math . min ( col + cols , COLUMNS ) const randomByte = ( ) => Math . floor ( Math . random ( ) * 256 ) for ( let c = col ; c < colEnd ; c ++ ) displayColours [ line * COLUMNS + c ] = randomByte ( ) const l0 = ( line + 1 ) * COLUMNS + col const lZ = Math . min ( line + lines , LINES ) for ( let l = l0 ; l < lZ * COLUMNS ; l += COLUMNS ) { const start = line * COLUMNS + col const end = start + cols displayColours . copyWithin ( l , start , end ) } const y0 = line * COLUMNS * CHARSIZE for ( let c = col ; c < colEnd ; c ++ ) displayPixels [ y0 + c ] = randomByte ( ) const yEnd = Math . min ( line + lines , LINES ) * COLUMNS * CHARSIZE for ( let y = y0 + COLUMNS + col ; y < yEnd ; y += COLUMNS ) displayPixels . copyWithin ( y , y0 + col , y0 + colEnd ) }
randomizeAreaX():
  Randomizes the specified area of the virtual display.
randomizeAreaX () : Randomizes the specified area of the virtual display .
//
 //
 // randomize the colour attributes on one line
 //
 // copy colour attributes to following lines
 // create some random pixels
 //
 // copy the random pixels to other lines
 //                                                              randomizeAreaX
