Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
Anonymous
unregistriert
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
int SpielenMittel (float Auswahl, string Spielername, int t, int PunkteMittel, int &VorherigePunkteMittel) { cout << "1.1" << endl; cout << "2.3" << endl; cout << "3.5\t\t\t" << Spielername << ": " << PunkteMittel << " Punkte" << endl; cin >> Auswahl; if (Auswahl == 4.7) { PunkteMittel += 5; } cin >> Auswahl; if (Auswahl == 5.9) { PunkteMittel += 5; } cin >> Auswahl; if (Auswahl == 7.1) { PunkteMittel += 5; } cout << "9.3\t\t\t" << Spielername << ": " << PunkteMittel << " Punkte" << endl; cin >> Auswahl; if (Auswahl == 8.3) { PunkteMittel += 5; } cout << "Du hast " << PunkteMittel << " Punkte erreicht!!" << endl; if (PunkteMittel >= VorherigePunkteMittel) { cout << "NEUER HIGHSCORE!!" << endl; VorherigePunkteMittel += PunkteMittel; } else { cout << "Leider kein neuer Highscore..." << endl; } |
Anonymous
unregistriert
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
int SpielenLeicht (float Auswahl, string Spielername, int t, int PunkteLeicht, int &VorherigePunkteLeicht) { cout << "1" << endl; cout << "2\t\t\t" << Spielername << ": " << PunkteLeicht << " Punkte" << endl; cin >> Auswahl; cout << endl; if (Auswahl == 3) { PunkteLeicht += 5; } cout << "4" << endl; cout << "5" << endl; cout << "6" << endl; cout << "7\t\t\t" << Spielername << ": " << PunkteLeicht << " Punkte" << endl; cin >> Auswahl; cout << endl; if (Auswahl == 8) { PunkteLeicht += 5; } cout << "9\t\t\t" << Spielername << ": " << PunkteLeicht << " Punkte" << endl; cin >> Auswahl; cout << endl; if (Auswahl == 10) { PunkteLeicht += 5; } cout << "Du hast " << PunkteLeicht << " Punkte erreicht!!" << endl; if (PunkteLeicht >= VorherigePunkteLeicht) { cout << "NEUER HIGHSCORE!!" << endl; VorherigePunkteLeicht += PunkteLeicht; } else { cout << "Leider kein neuer Highscore..." << endl; } for (t=6; t>0; t--) { Zeit (1000); } system ("cls"); return 0; } |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
#include "Spielen.hpp" #include "Timer.hpp" #include <string> #include <stdio.h> #include <time.h> #include <windows.h> #include "SpielenSchwer.hpp" using namespace std; #pragma comment (lib, "winmm.lib") int SpielenLeicht (float Auswahl, string Spielername, int t, int PunkteLeicht, int &VorherigePunkteLeicht); int SpielenMittel (float Auswahl, string Spielername, int t, int PunkteMittel, int &VorherigePunkteMittel); int Spielen (float Auswahl, string Spielername, int t) { int VorherigePunkteLeicht = 0; int VorherigePunkteMittel = 0; int VorherigePunkteSchwer = 0; int PunkteLeicht = 0; int PunkteMittel = 0; int PunkteSchwer = 0; while (Auswahl != 5) { cout << "SCHWIERIGKEITSGRAD" << endl; cout << "~~~~~~~~~~~~~~~~~~" << endl; cout << "1) Leicht" << endl; cout << "2) Mittel" << endl; cout << "3) Schwer" << endl; cout << "4) Highscore" << endl; cout << "5) Zurueck" << endl; cout << "~~~~" << endl; cout << "Deine Wahl: "; cin >> Auswahl; system ("cls"); if (Auswahl == 1) { SpielenLeicht (Auswahl, Spielername, t, PunkteLeicht, VorherigePunkteLeicht); } else if (Auswahl == 2) { SpielenMittel (Auswahl, Spielername, t, PunkteMittel, VorherigePunkteMittel); } else if (Auswahl == 3) { SpielenSchwer (Auswahl, Spielername, t, PunkteSchwer, VorherigePunkteSchwer); } else if (Auswahl == 4) { cout << "HIGHSCORE" << endl; cout << "~~~~~~~~~" << endl; cout << "Punkte Schw. Leicht: " << VorherigePunkteLeicht << endl; cout << "Punkte Schw. Mittel: " << VorherigePunkteMittel << endl; cout << "Punkte Schw. Schwer: " << VorherigePunkteSchwer << endl; cout << "Gesamtpunkte : " << VorherigePunkteLeicht + VorherigePunkteMittel + VorherigePunkteSchwer << endl; cout << "~~~~~~~~~" << endl; for (t=10; t>0; t--) { Zeit (1000); } system ("cls"); } else if (Auswahl == 5) { } else { cout << "ERROR: Falsche Eingabe!" << endl; for (t=1; t>0; t--) { Zeit (5000); } if (!cin.good ()) { cin.clear (); cin.ignore (); } system ("cls"); } } return 1; } int SpielenLeicht (float Auswahl, string Spielername, int t, int PunkteLeicht, int &VorherigePunkteLeicht) { cout << "1" << endl; cout << "2\t\t\t" << Spielername << ": " << PunkteLeicht << " Punkte" << endl; cin >> Auswahl; cout << endl; if (Auswahl == 3) { PunkteLeicht += 5; } cout << "4" << endl; cout << "5" << endl; cout << "6" << endl; cout << "7\t\t\t" << Spielername << ": " << PunkteLeicht << " Punkte" << endl; cin >> Auswahl; cout << endl; if (Auswahl == 8) { PunkteLeicht += 5; } cout << "9\t\t\t" << Spielername << ": " << PunkteLeicht << " Punkte" << endl; cin >> Auswahl; cout << endl; if (Auswahl == 10) { PunkteLeicht += 5; } cout << "Du hast " << PunkteLeicht << " Punkte erreicht!!" << endl; if (PunkteLeicht >= VorherigePunkteLeicht) { cout << "NEUER HIGHSCORE!!" << endl; VorherigePunkteLeicht += PunkteLeicht; } else { cout << "Leider kein neuer Highscore..." << endl; } for (t=6; t>0; t--) { Zeit (1000); } system ("cls"); return 0; } int SpielenMittel (float Auswahl, string Spielername, int t, int PunkteMittel, int &VorherigePunkteMittel) { cout << "1.1" << endl; cout << "2.3" << endl; cout << "3.5\t\t\t" << Spielername << ": " << PunkteMittel << " Punkte" << endl; cin >> Auswahl; if (Auswahl == 4.7) { PunkteMittel += 5; } cin >> Auswahl; if (Auswahl == 5.9) { PunkteMittel += 5; } cin >> Auswahl; if (Auswahl == 7.1) { PunkteMittel += 5; } cout << "9.3\t\t\t" << Spielername << ": " << PunkteMittel << " Punkte" << endl; cin >> Auswahl; if (Auswahl == 8.3) { PunkteMittel += 5; } cout << "Du hast " << PunkteMittel << " Punkte erreicht!!" << endl; if (PunkteMittel >= VorherigePunkteMittel) { cout << "NEUER HIGHSCORE!!" << endl; VorherigePunkteMittel += PunkteMittel; } else { cout << "Leider kein neuer Highscore..." << endl; } return 0; } |
C-/C++-Quelltext |
|
1 2 3 4 |
// Hier merken: (Funktion Spielen) int PunkteLeicht = 0; int PunkteMittel = 0; int PunkteSchwer = 0; |
C-/C++-Quelltext |
|
1 2 |
if(x == 0) cout << "x=0" << endl; |
C-/C++-Quelltext |
|
1 2 |
if(x == 0) cout << "x=0" << endl; |
Anonymous
unregistriert
Hast du wenigstens meine anderen Punkte zur Kenntnis genommen? :roll:Zitat von »"Spiri"«
Ehm...
Ich mag t's Ó.Ò
Werbeanzeige