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
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 |
class game { public: bool is_done () const; bool play (); }; class game_tetris : public game { }; class game_super_mario : public game { }; // [...] std::vector<game*> games; games.push_back (new game_tetris ()); games.push_back (new game_super_mario ()); for (; games.size (); ) { const int id = rand () % games.size (); game* current = games[id]; while (!current->is_done ()) current->play (); delete games[id]: games.remove (games[id]); } |
Anonymous
unregistriert
Zitat von »"unsigned long"«
Keine Garantie! Bin gerade vor keinem Compiler, das ist alles Notepad
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 class game { public: bool is_done () const; bool play (); }; class game_tetris : public game { }; class game_super_mario : public game { }; // [...] std::vector<game*> games; games.push_back (new game_tetris ()); games.push_back (new game_super_mario ()); for (; games.size (); ) { const int id = rand () % games.size (); game* current = games[id]; while (!current->is_done ()) current->play (); delete games[id]: games.remove (games[id]); }
C-/C++-Quelltext |
|
1 2 3 |
i=Zufallzahl; (i*)->Spielefuntion |
Anonymous
unregistriert
Anonymous
unregistriert
Zitat von »"raXor"«
Luca, wenn ich von Klassen und Pointer noch keine Ahnung hätte, dann würde ich mich nicht an ein Programm mit 20 Minispielen wagen. Lerne erstmal noch die Grundlagen, denn so wird das auf jedenfall scheitern. So schwer zu verstehen ist der Code von ul nämlich nicht...
Zitat von »"Luca"«
Zitat von »"raXor"«
Luca, wenn ich von Klassen und Pointer noch keine Ahnung hätte, dann würde ich mich nicht an ein Programm mit 20 Minispielen wagen. Lerne erstmal noch die Grundlagen, denn so wird das auf jedenfall scheitern. So schwer zu verstehen ist der Code von ul nämlich nicht...
das progg is fast fertisch
Werbeanzeige