Flags: Worked Examples

From ProgZoo
Revision as of 11:54, 18 August 2021 by Andr3w (talk | contribs) (Benin)
Jump to navigation Jump to search

1) Benin

<youtube>https://youtu.be/mFAh1z4njMU</youtube>

  • The flag is 150 by 100
  • The green rectangle is 50 by 100
  • The yellow and red rectangles are 100 by 50
Flag of Benin

Input


Output

function drawFlag(ctx)
{
}  
function drawFlag(ctx)
{
  ctx.fillStyle = 'green';
  ctx.fillRect(0,0,50,100);
  ctx.fillStyle = 'yellow';
  ctx.fillRect(50,0,100,50);
  ctx.fillStyle = 'red';
  ctx.fillRect(50,50,100,50);
}  
Served by: dill at 2025-07-21T21:22

Navigation menu