<canvas width = "600" height="400"> </canvas>
<script>
var pantalla = document.querySelector("canvas");
var pincel = pantalla.getContext("2d");
pincel.fillStyle = "darkgreen";
pincel.fillRect(0,0,350,300);
pincel.strokeStyle = "black";
pincel.strokeRect(0,0,350,300);
pincel.fillStyle = "green";
var numero = 0;
var numero2 = 0;
while (numero2<300) {
while (numero < 350) {
pincel.fillRect(numero,numero2,35,30);
pincel.fillRect(numero+35,numero2+30,35,30);
numero = numero + 35 * 2;
}
numero2 = numero2 + 30 * 2;
numero = 0
}
pincel.fillStyle = "black";
pincel.fillRect(50, 25, 90, 90);
pincel.fillRect(210, 25, 90, 90);
pincel.fillRect(140, 115, 70, 100);
pincel.fillRect(100, 150, 40, 110);
pincel.fillRect(210, 150, 40, 110);