How to reduce this code?
void rezultat()
{
if (kub_act_1.sleep())
{
if (cskel_1.getPoint("4").pos.y<=pos)D.text(-1.20,0.95,S+"< 3 >");
if (cskel_1.getPoint("1").pos.y<=pos)D.text(-1.20,0.95,S+"< 6 >");
if (cskel_1.getPoint("3").pos.y<=pos)D.text(-1.20,0.95,S+"< 4 >");
if (cskel_1.getPoint("6").pos.y<=pos)D.text(-1.20,0.95,S+"< 1 >");
if (cskel_1.getPoint("2").pos.y<=pos)D.text(-1.20,0.95,S+"< 5 >");
if (cskel_1.getPoint("5").pos.y<=pos)D.text(-1.20,0.95,S+"< 2 >");
}
if (kub_act_2.sleep())
{
if (cskel_2.getPoint("4").pos.y<=pos)D.text(-1.0,0.95,S+"< 3 >");
if (cskel_2.getPoint("1").pos.y<=pos)D.text(-1.0,0.95,S+"< 6 >");
if (cskel_2.getPoint("3").pos.y<=pos)D.text(-1.0,0.95,S+"< 4 >");
if (cskel_2.getPoint("6").pos.y<=pos)D.text(-1.0,0.95,S+"< 1 >");
if (cskel_2.getPoint("2").pos.y<=pos)D.text(-1.0,0.95,S+"< 5 >");
if (cskel_2.getPoint("5").pos.y<=pos)D.text(-1.0,0.95,S+"< 2 >");
}
if (kub_act_3.sleep())
{
if (cskel_3.getPoint("4").pos.y<=pos)D.text(-0.8,0.95,S+"< 3 >");
if (cskel_3.getPoint("1").pos.y<=pos)D.text(-0.8,0.95,S+"< 6 >");
if (cskel_3.getPoint("3").pos.y<=pos)D.text(-0.8,0.95,S+"< 4 >");
if (cskel_3.getPoint("6").pos.y<=pos)D.text(-0.8,0.95,S+"< 1 >");
if (cskel_3.getPoint("2").pos.y<=pos)D.text(-0.8,0.95,S+"< 5 >");
if (cskel_3.getPoint("5").pos.y<=pos)D.text(-0.8,0.95,S+"< 2 >");
}
if (kub_act_4.sleep())
{
if (cskel_4.getPoint("4").pos.y<=pos)D.text(-0.6,0.95,S+"< 3 >");
if (cskel_4.getPoint("1").pos.y<=pos)D.text(-0.6,0.95,S+"< 6 >");
if (cskel_4.getPoint("3").pos.y<=pos)D.text(-0.6,0.95,S+"< 4 >");
if (cskel_4.getPoint("6").pos.y<=pos)D.text(-0.6,0.95,S+"< 1 >");
if (cskel_4.getPoint("2").pos.y<=pos)D.text(-0.6,0.95,S+"< 5 >");
if (cskel_4.getPoint("5").pos.y<=pos)D.text(-0.6,0.95,S+"< 2 >");
}
if (kub_act_5.sleep())
{
if (cskel_5.getPoint("4").pos.y<=pos)D.text(-0.4,0.95,S+"< 3 >");
if (cskel_5.getPoint("1").pos.y<=pos)D.text(-0.4,0.95,S+"< 6 >");
if (cskel_5.getPoint("3").pos.y<=pos)D.text(-0.4,0.95,S+"< 4 >");
if (cskel_5.getPoint("6").pos.y<=pos)D.text(-0.4,0.95,S+"< 1 >");
if (cskel_5.getPoint("2").pos.y<=pos)D.text(-0.4,0.95,S+"< 5 >");
if (cskel_5.getPoint("5").pos.y<=pos)D.text(-0.4,0.95,S+"< 2 >");
}
}
|