First give the background the colour white, then we can attack the first line. Choose two to three colours randomly between yellow, red, blue and black. Add white to the selection and stock the number 2 in a variable. Draw a square and fill it with a random colour chosen in the selection then replace 2 by either 0 or 1. Do it 38 more times to finish the line but this time if 0, fill the square with a different color that the one before, if 1, fill it with the same one. Then restart these steps with the following 38 lines.
Create two colors palettes one with 4 colors and the other with 3 then give the background the colour white.Chose one of the palettes, draw a square, fill it with one of the colors. Do it 38 more times to finish the line but stock a random number in a variable, if it is inferior to a certain value change the color otherwise keep the old one. Then restart these steps with then following 38 lines.