# Draw these shapes

Given: a width, a height, and a set of sets of points. Output: An image where each set of points is connected and colored in (like a shape). Each shape must be a different color from all of the other shapes, but the actual color doesn't matter as long as each color is distinct. The shapes must be in order; whether you start at the end or the beginning of the set doesn't matter, though. The dots must be connected in the order they're given in the set.

Output formats are in accordance with standard image rules.

## Examples

//the code here has nothing to do with the actual challenge and just shows examples

document.getElementById("one").getContext("2d").fillRect(0, 0, 300, 300)
const ctx = document.getElementById("two").getContext("2d")
ctx.fillStyle = "black"
ctx.beginPath();ctx.moveTo(0,0);ctx.lineTo(0,300);ctx.lineTo(300,0);ctx.closePath();ctx.fill()
ctx.fillStyle = "lime"
ctx.beginPath();ctx.moveTo(200,0);ctx.lineTo(600,0);ctx.lineTo(300,300);ctx.closePath();ctx.fill()
canvas {border: 1px dotted black}
<pre>Width: 500, Height: 500, Set: [[[0, 0], [0, 300], [300, 300], [300, 0]]]</pre>
<canvas id="one" width="500" height="500"></canvas>

<pre>Width: 600, Height: 300, Set:
[
[[0,0], [0,300], [300,0]],
[[200,0], [600,0], [300,300]]
]</pre>
<canvas id="two" width="600" height="300"></canvas>

Scoring is .

• I meant to ask this question in the Sandbox but what qualities as a "different" colour? Is #000000 different to #000001? Mar 24, 2019 at 0:11
• Also, what output formats are allowed? Is a base-64 encoded PNG outputted as s string OK? Or the XML markup of an SVG? Mar 24, 2019 at 0:26
• How are we supposed to connect the shapes? Suppose it's a pentagon. Which points go with which points? Mar 24, 2019 at 3:00
• @SHaggy I am assuming that this question is using a standard image I/O format Mar 24, 2019 at 15:32
• I am voting to close because it doesn't say how we should connect the dots. Mar 24, 2019 at 15:32

function(w,h,p){plot.new();plot.window(c(0,w),c(0,h));polygon(p,c=1:8)}