pROGRAME



  • // ich habe ein spiel Programirt :

    #include<cstdlib>
    #include<ctime>
    #include<iostream>
    #include<string>
    #include<cctype>
    using namespace std;

    void GR()
    {
    Scara::DreheNachLinks();Scara::DreheNachLinks();Scara::DreheNachLinks();
    }

    void GL()
    {
    Scara::DreheNachLinks();
    }
    void G3()
    {
    Scara::Gehen();Scara::Gehen();Scara::Gehen();
    }
    void G2()
    {
    Scara::Gehen();Scara::Gehen();
    }
    void vw ()
    {
    if(Scara::IstVorneAbgrund()==false)
    {
    if (Scara::IstVornePalette()==false)
    {
    Scara::Gehen();
    }
    }
    }
    void G1()
    {
    Scara::Gehen();
    }
    void vor()
    {
    while (Scara::IstVorneAbgrund()==false)
    { G1();
    }}
    void G5()
    {
    G3();
    G2();
    }
    void G4()
    {
    G2();
    G2();
    }
    void G7()
    {
    G5();
    G2();
    }
    void G6()
    {
    G4();
    G2();
    }
    void G8()
    {
    G5();
    G3();
    }

    void Rechteck(int x,int y,int h,int b)
    {
    Zeichenbrett::ZeichneLinie(x,y,x+b,y);
    Zeichenbrett::ZeichneLinie(x,y+h,x+b,y+h);
    Zeichenbrett::ZeichneLinie(x,y,x,y+h);
    Zeichenbrett::ZeichneLinie(x+b,y,x+b,y+h);
    }
    int main()
    {

    int b=1 ,a ,c ,d=1 ;
    cout<< " 2 = Halbe Drehung, 8 = 1Felt nach vorne, 6 = Rechts Drehen, 4 = Lings Drehen " <<endl;
    cout<< "" <<endl;
    cout<< " 5 = Springen " <<endl;
    cout<< " 7 = wo ist ein Felt? " <<endl;
    cout<< " 9 = gehe bis zum apgrund. " <<endl;
    cout<< "" <<endl;
    cout<< " 3 = Erweitere opzonen " <<endl;
    cout<< "" <<endl;
    cout<< "" <<endl;
    cout<< " Level: " <<endl;
    cin >> c;

    Scara::Starten(c);
    Scara::Drehverzoegerung(false);

    while(d= 1)

    {

    Zeichenbrett::LoescheTextfenster();
    cout<< " 2 = Halbe Drehung, 8 = 1Felt nach vorne, 6 = Rechts Drehen, 4 = Lings Drehen " <<endl;
    cout<< "" <<endl;
    cout<< " 5 = Springen " <<endl;
    cout<< " 7 = wo ist ein Felt? " <<endl;
    cout<< " 9 = gehe bis zum apgrund. " <<endl;
    cout<< "" <<endl;
    cout<< " 3 = Erweitere opzonen " <<endl;
    cout<< "" <<endl;
    cout<< "" <<endl;

    cin >> a;
    if ( a==1)
    {
    if (a==2)
    {Scara::TempoNormal();
    }
    if (a==1)
    {Scara::TempoSchnell();
    }

    }

    if (a==3)
    {
    cout << " 1 = Nimm Palette ,2= Lege Palette Ab, 3 = Verschiebe Stein! , 4 = MerkePosition, 5 = SpringeZurueck "<<endl;
    cin >> a;
    if (a==2)
    {
    Scara::LegePaletteAb();
    }
    if (a==1)
    {
    Scara::NimmPalette();
    }
    if (a==3)
    {
    Scara::VerschiebeStein();
    }
    if (a==4)
    {
    Scara::MerkePosition();
    }

    cin >> a;
    }
    if (a==5)
    {
    cout<< "wie Weit? " <<endl;
    cin >> a;
    Scara::Springe(a);

    }

    if (a==7)
    {
    if (Scara::IstVorneAbgrund()==false)
    {
    cout<< "Vorne Ales Frei " <<endl;
    }
    else
    { cout<< "Nicht Vorne Ales Frei " <<endl;
    }
    GL();
    if (Scara::IstVorneAbgrund()==false)
    {
    cout<< "Lings Ales Frei " <<endl;
    }
    else
    { cout<< "Nicht Lings Ales Frei " <<endl;
    }
    GL();
    if (Scara::IstVorneAbgrund()==false)
    {
    cout<< "Hinten Ales Frei " <<endl;
    }
    else
    { cout<< "Nicht Hinten Ales Frei " <<endl;
    }
    GL();if (Scara::IstVorneAbgrund()==false)
    {
    cout<< "Rechts Ales Frei " <<endl;
    }
    else
    { cout<< "Nicht Rechts Ales Frei " <<endl;
    }
    GL();

    }

    if ( a == 320);
    {
    Scara::Starten(32);
    Scara::Drehverzoegerung(false);
    int a= 1;
    while ( a= 1)
    {
    if(Scara::StehtAufAnkh() ==true)
    { Scara::Beenden(); }

    vor();

    if(Scara::StehtAufAnkh() ==true)
    { Scara::Beenden(); }

    GR();

    if(Scara::StehtAufAnkh() ==true)
    { Scara::Beenden(); }

    vor();

    if(Scara::StehtAufAnkh() ==true)
    { Scara::Beenden(); }

    GR();
    GR();

    if(Scara::StehtAufAnkh() ==true)
    { Scara::Beenden(); }

    vor();

    if(Scara::StehtAufAnkh() ==true)
    { Scara::Beenden();
    }

    }}
    }
    if (a==8)
    {
    if( c>5)
    {
    if (Scara::IstVorneAbgrund()==false)
    {
    cout<< "Ales Frei " <<endl;
    Scara::Gehen();
    Scara::TempoSchnell();
    }
    else
    {
    cout<< "Darf nicht" <<endl;
    }
    } else
    {
    G1();
    }

    }

    if (a==4)
    {
    GL();
    }
    if (a==2)
    {
    GL();GL();
    }
    if (a==9)
    {
    vor();
    }
    if (a==6)
    {
    GR();
    }
    if (a==0)
    {
    if (c <11)
    {
    Scara::Beenden();
    }
    else
    {
    if ( Scara:: StehtAufAnkh ())
    {
    Scara::Beenden();
    }

    }
    }
    if (a==5)
    {
    if (Scara::IstVorneAbgrund()==false)
    {
    cout<< "ich mus nicht springen " <<endl;
    }
    else
    {
    cout<< "Wie weit? " <<endl;
    cin >> a;
    Scara::Springe(a);
    }

    }
    }

    //man mus arber noch sara verbinden .

    Hat jemand noch edhen ? dan schik mir bitte eine Naricht.



  • Hab mir den Code nur ein wenig angeschaut. Aber das schreit doch nach OOP.


Anmelden zum Antworten