<canvas width="600" height="400"></canvas>
<script>
pantalla = document.querySelector("canvas");
pincel = pantalla.getContext("2d");
pincel.fillStyle = "darkgreen";
pincel.fillRect(0,0,350,300)
function negro() {
pincel.fillStyle = "black"
}
negro();
pincel.fillRect(50,60,90,90);
pincel.fillRect(210,60,90,90);
negro();
pincel.fillRect(140,150,70,100);
negro();
pincel.fillRect(100,190,40,110);
pincel.fillRect(210,190,40,110);
</script>