need help ASAP for filling in a code that draws a circle

I need to write a loop that goes from 0 to bits.length, and then inside the loop, I have to set two different colors using strokeStyle and fillStyle. Then use the arc function to create a circle at the current bit's x and y position, with the bit's radius (i.e. bits[I].x, bits[I].y and bits[I].radius). Last, use fill() to draw the filled circle and stroke() to draw the circle's outline. I am using the JavaScript language btw.

x: 100
y: 100
dir: 0
radius: 50
open: true


[code]
function drawBits(ctx)
{
//write a loop that goes from 0 to bits.length
// set strokeStyle and fillStyle on ctx to different colors
// use arc() to draw a circle at bits[I].x and bits[I].y with bits [I].radius as the radius
// call fill() and stroke() on ctx
}

ctx refers to:

ctx.beginPath()
ctx.strokeStyle = "black"
ctx.fillStyle = "yellow"
Last edited on
What language is this? It doesn't look like C++. We might be able to help but not unless we know your language and environment.
Last edited on
I'm using JavaScript in Brackets
Topic archived. No new replies allowed.