Help with horse race 2.0



  • Can anyone help me to program the probabilities?

    if(Spiel == "P" || Spiel == "p" || Spiel == "Pferderennen"){
    system("CLS");
    cout << display <<endl;
    cout << display2 <<endl;
    cout << display3 <<endl;
    cout << display4 <<endl;
    cout << display5 <<endl;
    cout << display6 <<endl;
    cout << display7 <<endl;
    int Pferdenummer;
    int Gewinner;
    string eingabe;
    int i,u,z,t,r,e;
    long long int Spielgeld;
    i = 0;
    while(i==0){
    if(Kontostand == 0){
    string Seele;
    int Pleite;
    int Pleite2;
    cout << "Du bist Pleite, mochtest du russisches Roulette Spielen Um 10000 Coins zu gewinnen." <<endl;
    cout << "Ja oder Nein?" <<endl;
    cin >> Seele;
    if(Seele == "J" || Seele == "j" || Seele == "Ja" || Seele == "ja" || Seele == "ja"){
    Pleite = (rand() % 6) + 1;
    Pleite2 = (rand() % 6) + 1;
    if(Pleite == Pleite2){
    cout << "Du bist tot sorry" <<endl;
    i++;
    y++;
    }
    else{
    cout << "Du hattest gluck hier hast du weitere 5000 Coins." <<endl;
    Kontostand = Kontostand + 5000;
    i++;
    }
    }
    else if(Seele == "N"){
    cout << "Schade war ein versuch wert." <<endl;
    i++;
    y++;
    }
    else{
    cout << "Du laberst scheiße und bist tot" <<endl;
    i++;
    y++;
    }
    }
    srand(time(0));
    cout << "Du hast noch: " << Kontostand << " coins." <<endl;
    cout << "Willst du eine Runde Spielen(S) oder willst du aufhoren(A)" <<endl;
    cin >> eingabe;
    if(eingabe == "A" || eingabe == "a"){
    i++;
    }
    if(eingabe == "S" || eingabe == "s"){
    cout << "Mit wie vielen Coins willst du spielen?" <<endl;
    cin >> Spielgeld;
    while(u==0){
    if(Spielgeld > Kontostand){
    cout << "So viel coins hast du nicht" <<endl;
    cout << "Deine Kontostand betragt: " << Kontostand << " coins"<<endl;
    cout << "Mit wie vielen Coins willst du spielen?" <<endl;
    cin >> Spielgeld;
    }
    else{
    u++;
    Kontostand = Kontostand - Spielgeld;
    }
    }
    cout << "Auf welches Pferd willst du wetten? (1-6)" <<endl;
    cin >> Pferdenummer;

                        Gewinner = (rand() % 6) + 1;
                            
                    if(Pferdenummer == Gewinner){
                        system("CLS");
                        cout << display <<endl;
                        cout << display2 <<endl;
                        cout << display3 <<endl;
                        cout << display4 <<endl;
                        cout << display5 <<endl;
                        cout << display6 <<endl;
                        cout << display7 <<endl;
                        cout << "Dein Pferd hat gewonnen" <<endl;
                        Kontostand = Kontostand + Spielgeld*2;
                    }
                    else{
                        system("CLS");
                        cout << display <<endl;
                        cout << display2 <<endl;
                        cout << display3 <<endl;
                        cout << display4 <<endl;
                        cout << display5 <<endl;
                        cout << display6 <<endl;
                        cout << display7 <<endl;
                        cout << "Du hast verloren, dass gewinner Pferd ist Nummer " << Gewinner <<endl;      
                    }
                }
            }
        }
    

    Thank you 🍺



  • This is a joke, right?



  • Why do you post english when you´re german?





  • @MadCookie

    1. You post in English but the variables & messages in your code are in German. What's up with that? Falls du es nicht bemerkt haben solltest: das ist ein deutsches Forum hier, du kannst ruhig deutsch schreiben.
    2. Please use code tags. No, I won't tell you how to do that, it's easy enough to find that out on your own. Posting code without code tags is just rude, nobody likes to read code that's not indented and not syntax-colored because it doesn't use code tags.
    3. This is only a partial source, there are parts missing (e.g. we don't see how/where display ... display7 are defined).
    4. I have no idea what you're asking. What exactly do you mean by "program the probabilities"? The winner is chosen by Gewinner = (rand() % 6) + 1; which should give you an almost equal distribution -- assuming that rand() is equally distributed, which it should be.

    So...

    Can anyone help me to program the probabilities?

    Probably. If you ask a clear question in a meaningful way. Otherwise: no, since we don't even know what you want.

    ps: Ignoring this thread like you did the other one + opening yet another similar one in a few days will not increase your chances of getting the answers you're hoping for. Trying to figure out what you did wrong & improving your question might.



  • @DocShoe Maybe it's not his code. Well, probably it's not his code. Still confusing.



  • That's where the dog goes crazy in se pan!



  • @Swordfish
    🙂
    That phrase is surprisingly hard to translate, especially the "da" part, for which there isn't really a suitable English translation. I'd probably have translated it as "that makes the dog in the pan go crazy".
    (Also the German original is a bit ambiguous, it could mean "the dog in the pan goes crazy" or as you interpreted it, "the dog goes crazy in the pan". Very subtle difference, but still.)



  • @Swordfish
    Just smiling like honey cake horse 😜



  • Equal goes the race loose.
    Caution! Ready! Loose!
    Yes where run they then?

    PS: "Russisches Roulette" hat mein Chemielehrer damals zu Beginn jeder Stunde 3x gespielt. Bei 1 hat der alphabetisch erste Schüler Pech gehabt und wurde ein paar Minuten lang gegrillt, bei 2. der 2. usw. - bei 0 war Ende und bei einer Zahl > nSchüler war "Glück". Wir haben sehr viel bei diesem Lehrer gelernt, weil man Angst hatte dranzukommen. Er hatte dazu einen kleinen Roulettetisch, d.h. es war zufällig, wer dran kam und nicht "Lehrers Liebling kommt nicht dran".



  • @hustbaer sagte in Help with horse race 2.0:

    @DocShoe Maybe it's not his code. Well, probably it's not his code. Still confusing.

    Egal, hier:
    https://www.c-plusplus.net/forum/topic/352562/aus-cpp-projekt-eine-exe-datei-machen/3
    hat der Scheuerbeutel einen deutschen Kommentar hinterlassen, es bleibt also ein Rätsel, warum er hier in fremder Zunge spricht ...
    Mich motiviert das jedenfalls nicht 😕



  • @Belli
    Ah. Faszinierend. Motivieren tut es mich aber auch nicht 🙂



  • Account sharing?



  • heult nicht so rum, bin deutsch, aber woher soll ich wissen das das ein deutsches forum ist. 🍺





  • @Cardiac sagte in Help with horse race 2.0:

    keine ahnung....

    https://i.imgur.com/j1X0sL5.png

    🤣



  • @MadCookie sagte in Help with horse race 2.0:

    heult nicht so rum, bin deutsch, aber woher soll ich wissen das das ein deutsches forum ist. 🍺

    Ich glaube, das kann man ergoogeln ...



  • @MadCookie
    Du machst heute meinen Tag schöner. Selten so gut am amüsiert.👍


  • Gesperrt

    Das Programm habe ich geklaut und meinem Lehrer gesagt, dass ich es selber gemacht habe, habe eine 1 bekommen, sehr gutes Ding. Kürzer ist manchmal auch besser.


  • Mod

    Komm, setz' deinen Spamlink und spare uns allen die peinliche Phase in der wir so tun, als wärst du ein ganz normaler neuer Nutzer, der aus echtem Interesse unter alte Beiträge einen nichtssagenden Kommentar schreibt.


Anmelden zum Antworten