The task is to create 1 pixel wide coloured vertical pinstripes with a sufficient number of pinstripes to span the entire width of the graphics display.



The pinstripes should either follow the system palette sequence,   or a sequence that includes:

black,   red,   green,   blue,   magenta,   cyan,   yellow,   and   white:

   after filling the top quarter, switch to a wider 2 pixel wide vertical pinstripe pattern,
   halfway down the display, switch to 3 pixel wide vertical pinstripe,
   finally to a 4 pixels wide vertical pinstripe for the last quarter of the display.


See also

   display black and white 
   print colour


code ChIn=7, Point=41, SetVid=45;
int X, Y, W, C;
[SetVid($13);                   \set 320x200 graphics mode in 256 colors
for Y:= 0 to 200-1 do           \for all the scan lines...
    [W:= Y/50 + 1;              \width of stripe = 1, 2, 3, 4
    C:= 0;                      \set color to black so first pixel becomes blue
    for X:= 0 to 320-1 do       \for all the pixels on a scan line...
        [if rem(X/W) = 0 then C:= C+1;  \cycle through all system colors
        Point(X, Y, C);         \set pixel at X,Y to color C
        ];
    ];
X:= ChIn(1);                    \wait for keystroke
SetVid(3);                      \restore normal text mode display
]