<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CANVAS</title>
</head>
<body>
<canvas width = "600" height = "400"></canvas>
<script>
function dibujarCuadrado(x,y){
var lienzo = document.querySelector("canvas");
var pincel = lienzo.getContext("2d");
pincel.fillStyle = "green";
pincel.fillRect(x,y,50,50);
pincel.strokeStyle = "black";
pincel.strokeRect(x,y,50,50);
}
dibujarCuadrado(0,0);
dibujarCuadrado(50,0);
dibujarCuadrado(100,0);
</script>
</body>
</html>