Difference between revisions of "Easy Flags"

From ProgZoo
Jump to navigation Jump to search
Line 11: Line 11:
function drawFlag(ctx)
function drawFlag(ctx)
{
{
   ctx.fill = 'green';
   ctx.fillStyle = 'green';
   ctx.fillRect(0,0,75,100);
   ctx.fillRect(0,0,75,100);
}   
}   
Line 18: Line 18:
function drawFlag(ctx)
function drawFlag(ctx)
{
{
   ctx.fill = 'green';
   ctx.fillStyle = 'green';
   ctx.fillRect(0,0,150,100);
   ctx.fillRect(0,0,150,100);
}   
}   
</pre>
</pre>
</div>
</div>

Revision as of 10:23, 1 August 2021

<canvas width=150 height=100></canvas>
drawFlag(document.querySelector('canvas').getContext('2d'));

Libya

What is 6 times 7?

function drawFlag(ctx)
{
  ctx.fillStyle = 'green';
  ctx.fillRect(0,0,75,100);
}  
function drawFlag(ctx)
{
  ctx.fillStyle = 'green';
  ctx.fillRect(0,0,150,100);
}