<canvas id="tela" width="600" height="400"></canvas>
<script>
var desenhaQuadradoVerde = function(x,y) {
var tela = document.getElementById("tela");
var c = tela.getContext("2d");
c.fillStyle = "green";
c.fillRect(x,y,50,50);
c.strokeStyle = "black";
c.strokeRect(x,y,50,50);
}
</script>