Пример #1
0
void shakil:: mixed()
{ tm=0;ne2=0;
  cleardevice();
  showmouseptr();
  settextstyle(1,0,1);
  show();
  while(1)
  {getmousepos(&button,&x,&y);
   if((button & 1)==1)
   {cal();
    resu();
    show();
    if(x>=470&&x<=520)
    {if(y>=370&&y<=390)
    {ne2=10;
     break; }
    if(y>=270&&y<=290)
    {save1();   }

   } }

   if(result==10)
   {settextstyle(1,0,10);
    outtextxy(50,100,"YOU WIN");
    delay(1000);
    getch();
    break;
   }
}
hidemouseptr();
result=0;
cleardevice();
showmouseptr();
}
Пример #2
0
Vector3D Terrain::norm(const Vector2D &p) const
{
    Vector2D px(p.x()+epsilon,p.y());
    Vector2D pxminus(p.x()-epsilon, p.y());
    Vector2D py(p.x(),p.y()+epsilon);
    Vector2D pyminus(p.x(),p.y()-epsilon);

    double hpx=getHauteur(px);
    double hpxminus = getHauteur(pxminus);
    double hpy=getHauteur(py);
    double hpyminus = getHauteur(pyminus);
    Vector3D resu(-(hpx-hpxminus),2*epsilon,-(hpy-hpyminus));
    resu.normalize();
    return resu;


}
Vector3D Terrain::norm(const Vector2D &p)
{
   /* Vector2D px(p.x()+epsilon,p.y());
    Vector2D py(p.x(),p.y()+epsilon);

    double hp=getHauteur(p);
    double hpx=getHauteur(px);
    double hpy=getHauteur(py);

    Vector3D vp(p.x(),p.y(),(double)hp);

    Vector3D vpx(px.x(),px.y(),(double)hpx);

    Vector3D vpy(py.x(),py.y(),(double)hpy);

    Vector3D u=vpx-vp;
    Vector3D v=vpy-vp;

    Vector3D n(-u.z()/u.x(),1.0f,-v.z()/v.y());
    n.normalize();

    return n;*/

    //std::cout<<p.x()<<" "<<p.x()+epsilon<<std::endl;

    Vector2D px(p.x()+epsilon,p.y());
    Vector2D pxminus(p.x()-epsilon, p.y());
    Vector2D py(p.x(),p.y()+epsilon);
    Vector2D pyminus(p.x(),p.y()-epsilon);

    double hpx=getHauteur(px);
    double hpxminus = getHauteur(pxminus);
    double hpy=getHauteur(py);
    double hpyminus = getHauteur(pyminus);
    //std::cout<<hpx<<" "<<hpxminus<<std::endl;
    Vector3D resu(-(hpx-hpxminus),2*epsilon,-(hpy-hpyminus));
    resu.normalize();
    return resu;


}
Пример #4
0
ll max_flow() {
    gap[0] = n * m;
    ll resu(0);
    while (dis[1][1] < n * m) resu += dfs(1, 1, INFF);
    return resu;
}