So I basically want to create 5 sizes of circles randomly generated and placed in a circle around a point (the radius being 500 units) and I want to do this with javascript and jpgs.
Normally what I'd do is create a table and then just randomly fill it with imgs of say 5px, but the differing sizes are giving me a problem on how to solve this, because if I create a table of 5px imgs 200 cells wide & high and have the sizes represented in colors I know I would get overlap which I don't want.
Another solution that doesn't sound so good would be to instead of printing right to the web page put the 5px chunks in an array and then when I come across a size that takes up multiple cells add the chunks in the other rows, and then when I come to those columns in the array have it detect and jump over them, but that seems a bit of a mess.
Another possible idea that I just thought of is set a number of circles to be generated.
Generate the circle sizes.
Then for each size place the chunks in the cells.
check if cell and surrounding cells are filled
If a cell is filled with a circle chunk already, re-roll until the piece is placed...
Though thinking that through it comes to mind that that might generate the problem of never being able to find a place to fill and then going into an infinite loop
Is there a better solution than any of those?