38
\$\begingroup\$

The flag of Bangladesh is very simple. It looks like below:

enter image description here

The flag will be in bottle green (#006a4e) and rectangular in size in the proportion of length to width of 10:6, with a red circle in near middle. The red circle (#f42a41) will have a radius of one-fifth of the length of the flag. This image will help you to understand the proportions properly:

enter image description here

In this Graphical output challenge, you need to draw the flag of Bangladesh like first image. Standard loopholes apply, Shortest code wins.

Resolution cannot be 0px, or echo style answers not supported.

Minimum resolution is 286*176

\$\endgroup\$
4
  • 2
    \$\begingroup\$ Related: Plot a centered circle. I adapted my answer from there \$\endgroup\$
    – Kaddath
    Apr 20, 2021 at 7:52
  • 12
    \$\begingroup\$ Next challenge: draw the flag of Bhutan. \$\endgroup\$
    – Mark
    Apr 21, 2021 at 23:31
  • 12
    \$\begingroup\$ So basically every attempt of mine to center a circle in a div 😂 \$\endgroup\$
    – DeepSpace
    Apr 22, 2021 at 18:38
  • 2
    \$\begingroup\$ @Mark Mathematica, 23 bytes: "BT"~CountryData~"Flag" \$\endgroup\$
    – Makonede
    Jan 14, 2022 at 3:31

33 Answers 33

1
2
0
\$\begingroup\$

Desmos, 66 bytes

This:

r=rgb(244,42,65)
g=rgb(0,106,78)
-9≤x≤11\left\{yy≤36\right\}
xx+yy≤16

This is longer than the other one, but that other one didn't work, as \left and \right seems to be needed.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ This doesn't work when pasted in. \$\endgroup\$
    – emanresu A
    May 9, 2022 at 7:58
0
\$\begingroup\$

Perl 5 + -M5.10.0, 82 bytes

say"P6 300 180 255",map$=>((135-$_%300)**2+(90-$_/300)**2)**.5?".*A":".jN",0..54e3

Try it online!

Generates a PBM file by going through every co-ordinate and checking if the current pixel is within the circle, outputting the values for green or red respectively.

\$\endgroup\$
0
\$\begingroup\$

Pikchr, 75 bytes

box ht.45fill 27214 color off
circle at-3/80,0rad.15fill 0xf42a41 color off

Output

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 112.32 69.12">
<path d="M2,66L110,66L110,2L2,2Z" style="fill:rgb(0,106,78);"></path>
<circle cx="50" cy="34" r="21.6" style="fill:rgb(244,42,65);"></circle>
</svg>

\$\endgroup\$
1
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.