次のようなことができます:
int nrmedals; //number of medals
CGPoint bottompos; //position of the lower left corner of the rectangle where you want to draw
float padding; //space between medals
float diameter; //diameter of the medals
if (nrmedals%2==0) { //even
for (int i=0; i<nrmedals; i+=2) {
draw medal one at position (bottompos.x,bottompos.y+ i/2 * (diameter + padding));
draw medal two at position (bottompos.x+diameter+padding ,bottompos.y + i/2 * (diameter + padding));
}
}else {//odd
for (int i=0; i<nrmedals-1; i+=2) {
draw medal one at position (bottompos.x,bottompos.y+ i/2 * (diameter + padding));
draw medal two at position (bottompos.x+diameter+padding ,bottompos.y + i/2 * (diameter + padding));
}
draw odd medal at position (bottompos.x +diameter/2+padding/2 ,bottompos.y+diameter * (nrmedals-1)/2 +padding);
}
これが基本的な考え方です (もちろん、「2」を変数に置き換えることができ、行ごとに 2 つのメダルの代わりに、より多くのメダルを獲得できます)
ポイントを計算する数学の一部がオフになっている可能性があります