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


To run:
Start up.
Clear the screen.
Imagine a box with the screen's left and the screen's top and the screen's right and the screen's bottom divided by 4.
Make a color pinstripe given 1 pixel and the box.
Draw the color pinstripe.
Draw the next color pinstripe given the color pinstripe.
Draw the next color pinstripe given the color pinstripe.
Draw the next color pinstripe given the color pinstripe.
Refresh the screen.
Wait for the escape key.
Shut down.
 
A color pinstripe has a width and a box.
 
To make a color pinstripe given a width and a box:
Put the width into the color pinstripe's width.
Put the box into the color pinstripe's box.
 
To draw a color pinstripe:
Put the color pinstripe's box into a bound box.
Put the color pinstripe's width into a width.
Imagine a box with the bound's left and the bound's top and the width and the bound's bottom.
Put the bound's right divided by the width into an amount.
Loop.
If a counter is past the amount, exit.
Draw and fill the box with the black color. Move the box right the width.
Draw and fill the box with the red color. Move the box right the width.
Draw and fill the box with the green color. Move the box right the width.
Draw and fill the box with the blue color. Move the box right the width.
Draw and fill the box with the magenta color. Move the box right the width.
Draw and fill the box with the cyan color. Move the box right the width.
Draw and fill the box with the yellow color. Move the box right the width.
Draw and fill the box with the white color.
Repeat.
 
To draw the next color pinstripe given a color pinstripe:
Add 1 pixel to the color pinstripe's width.
Move the color pinstripe's box down the color pinstripe's box's height.
Draw the color pinstripe.